magic_enum icon indicating copy to clipboard operation
magic_enum copied to clipboard

Design Question Why is the API function based instead of variable based

Open ZXShady opened this issue 7 months ago • 0 comments

I see that the library internally needs constexpr inline variables to have static storage for them why doesn't the library expose them to be used directly by the user

https://github.com/Neargye/magic_enum/blob/master/include%2Fmagic_enum%2Fmagic_enum.hpp#L826-L827

here it just returns the variable.

https://github.com/Neargye/magic_enum/blob/master/include%2Fmagic_enum%2Fmagic_enum.hpp#L1215-L1221

This is late to change now or even discuss since it will be a major api break, but I was curious about why it was like that in the first place

ZXShady avatar Jun 09 '25 11:06 ZXShady