Extensible Name Plans

Thanks to C ++ 11, we have extended and strongly typed Enums.
But are there any plans for this extension?

Something like that:

enum class OneTwoThree : char {one=1, two=2, three=3}; enum class Four : char {four=4} extends OneTwoThree; 
+5
source share
1 answer

This is not true.

Nothing in C ++ happens without paper. Conveniently, you can browse all documents on the Internet here and follow along with a more informal discussion in the language evolution study groups on official forums (the Future Suggestions group is likely to be interesting for making changes to the listings).

For papers, a quick search for names for papers before 2011 reveals the following subject:

None of these documents include mechanisms for adding values ​​to existing enumerations. Similarly, a cursory search for "enum" in the Future Suggestions group yields a bunch of items, none of which are related to adding new values ​​to an enumeration somewhere other than the original definition of an enumeration.


Several attempts have been made to implement such functionality without libraries or languages; fooobar.com/questions/92210 / ... and may be useful to you.

+3
source

Source: https://habr.com/ru/post/1242878/


All Articles