Neargye / magic_enum

Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
MIT License
4.88k stars 434 forks source link

Enum Range limitation : is range more than UINT16_MAX possible #335

Closed Dadaduo closed 8 months ago

Dadaduo commented 8 months ago

enum class Color : uint32_t { alice_blue = 0xF0F8FF, // rgb(240,248,255) antique_white = 0xFAEBD7, // rgb(250,235,215) aqua = 0x00FFFF, // rgb(0,255,255) aquamarine = 0x7FFFD4, // rgb(127,255,212) azure = 0xF0FFFF, // rgb(240,255,255) beige = 0xF5F5DC, // rgb(245,245,220) bisque = 0xFFE4C4, // rgb(255,228,196) black = 0x000000, // rgb(0,0,0) };

color code ranges from 0x000000 to 0xFFFFFF. is it possible to enlarge range limitation for this kind of case?

Neargye commented 8 months ago

Done in master.

bxk-sonavex commented 8 months ago

Should this item in the limitations.md be removed or revised?

MAGIC_ENUM_RANGE = (MAGIC_ENUM_RANGE_MAX - MAGIC_ENUM_RANGE_MIN) must be less than UINT16_MAX.

Neargye commented 8 months ago

Yes, need to update