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@gmail.com>
Gesendet: Fr 14.03.2025 12:33
Betreff: Re: [std-proposals] lambdas in enums
An: std-proposals@lists.isocpp.org;
CC: Sebastian Wittmeier <wittmeier@projectalpha.org>; std-proposals@lists.isocpp.org;
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