Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

C++ Enum Trick Answer, Please.

$
0
0
Hello everyone we're approaching the holiday season! I am looking at the following specializing for C++ type information: struct Yes {}; struct No {}; . . template <typename T> struct IsPtr<T *> // unqualified ptr. { enum {result = true}; typedef Yes Result}; . . . The result is not the same as the different cased Result of the typedef? My other (more important) question is what is going on with the enum : enum {result = true}; I don't know this little trick, and the result = true is either that or false for each of the similar structs. Thank you; sincerely; Josheir

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>