Original Post
Hey, Is there a way to set or insure the size of a enum?
Quote:
Original post by OleKaiwalker
Okay, then you will not be exactly sure how big a enum is?
Quote:
Original post by Raduprv
What's the point to get the size of an enum anyway?
Quote:
Original post by Kibble Quote:
Original post by Raduprv
What's the point to get the size of an enum anyway?
For reading and writing them to a file is one example. Personally I use an int when serializing enums, but some might not.
enum type { large_value = ULONG_MAX};type func() { return large_value; }enum type;extern type func();enum<int> ENormalEnum {...};enum<float> // etc...enum<std::string> // this would be cool.enum<std::pair<int, float> > // weird.This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more