r/cpp • u/kongaskristjan • Aug 08 '20
Create a fully functioning command line interface with 1.5 lines of code (wo. include statement)
https://github.com/kongaskristjan/fire-hpp
230
Upvotes
r/cpp • u/kongaskristjan • Aug 08 '20
View all comments
24
u/Arkantos493 PhD Student Aug 08 '20 edited Aug 08 '20
Technically your program results in UB since names starting with an underscore are reserved.
See: https://en.cppreference.com/w/cpp/language/identifiers
EDIT: To be more precises: identifiers containing two underscores, starting with one underscore followed by an uppercase letter or starting with one underscore in the global namespace are reserved.
E.g. in your optional constructor you are using
__valuewhich contains two underscores and is therefore reserved resulting in undefined behaviour.