Date: Fri, 14 Mar 2025 12:37:54 +0100
The enum in this case could have a std::pair<int, float> as fundamental type instead.
Wouldn't that be simpler and more flexible, as this class (in this case std::pair) could provide added functionality, e.g. suitable constructors.
-----Ursprüngliche Nachricht-----
Von:Filip <fph2137_at_[hidden]>
Gesendet:Fr 14.03.2025 12:33
Betreff:Re: [std-proposals] lambdas in enums
An:std-proposals_at_[hidden];
CC:Sebastian Wittmeier <wittmeier_at_[hidden]>; std-proposals_at_[hidden];
sizeof an enum is essentially a sizeof its underlying type, so it should be the sum of sizeof of each type.
C and D are valid.
if the compiler can ( and should ) compare them and optimize the storage, then it could be optimized.
However then you would ensure that operator== is implemented for it to be used.
Cheers, Filip
Received on 2025-03-14 11:43:02