C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Fwd: Standardised Type Punning API for Wrapper Types

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 3 Sep 2024 00:16:38 +0200
Hi László,   the vector would be either a std::vector<float> or a std::vector<subtype>.   If you create a std::vector<subtype> one can convert the output, but not the whole vector as such.   The proposal of the OP was to be able to convert a wrapper type (container), if the element type is convertible.   So the proposals are symbiotic, but your proposal would not subsume or solve the request of the OP by itself.   -----Ursprüngliche Nachricht----- Von:Karafiát, László via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mo 02.09.2024 23:53 Betreff:Re: [std-proposals] Fwd: Standardised Type Punning API for Wrapper Types An:Sebastian Wittmeier via Std-Proposals <std-proposals_at_[hidden]>; CC:Karafiát, László <laszlo_at_[hidden]>; Well, the subtype of a float for example would automatically be 'converted' to float or double (i.e. 'seen' as such when needed) by the compiler. Except if you overload or hide that cast in your subtype definition. Would this not help?

Received on 2024-09-02 22:16:40