But you said before that D and E were correct and valid, although A and E have the same int and A and D the same float.
So you always have to provide the pair of numbers and not a single element can be back-converted into the enum.
-----Ursprüngliche Nachricht-----
Von: Filip <fph2137@gmail.com>
Gesendet: Fr 14.03.2025 15:23
Betreff: Re: [std-proposals] lambdas in enums
An: std-proposals@lists.isocpp.org;
CC: Sebastian Wittmeier <wittmeier@projectalpha.org>; std-proposals@lists.isocpp.org;
I would like any types to be listed, however I’m unsure about accessing them then.Using static_cast seems impossible with the same type written couple of times.Perhaps distinct types should be the only option here and dynamic_cast to access them, since it does evoke the idea of “change between inheritance”.I would like to avoid adding additional operator or keyword here so I’m open to suggestions. I also don’t like dynamic_cast here but it seems like, an option at least, that would not break anything.Cheers, FilipWiadomość napisana przez Sebastian Wittmeier via Std-Proposals <std-proposals@lists.isocpp.org> w dniu 14 mar 2025, o godz. 13:53:Do you want to allow
enum class E : int, int, int, int, int {
-----Ursprüngliche Nachricht-------
Von: Filip <fph2137@gmail.com>
Gesendet: Fr 14.03.2025 11:21
Betreff: Re: [std-proposals] lambdas in enums
An: std-proposals@lists.isocpp.org;
CC: Sebastian Wittmeier <wittmeier@projectalpha.org>; std-proposals@lists.isocpp.org;
C would be { 4, 0.0f }D would be { 5, 0.5f }We should probably not break the current functionality of storing the same value many times.All of them could be the same or different.
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals