magic_enum icon indicating copy to clipboard operation
magic_enum copied to clipboard

Add ADL way of defining `enum_range`

Open ZXShady opened this issue 7 months ago • 2 comments

Implements #381

ZXShady avatar Jun 09 '25 13:06 ZXShady

Neat! Much cleaner than my code.

What cases is magic_enum::customize::adl_info<true> meant to be used for?

Looks like line 196 of include/magic_enum/magic_enum.hpp should say bool instead of int

Thanks!

adl_info<true> means is_flags is true while adl_info<-10,10> means min max range

and good catch for the int in is_flags surprised I got no warnings (likely because it is all constexpr and the conversion is valid)

ZXShady avatar Jun 09 '25 15:06 ZXShady

I see. We should add documentation too. I made suggested documentation changes in doc/limitations.md and doc/reference.md in my repository (that was a fork of your repository) and submitted a pull request. I have no idea what I'm doing with GitHub, so apologies if I'm using the wrong features to do the suggestion. I can submit the files another way if you like.

https://github.com/ZXShady/magic_enum/pull/1

lsemprini avatar Jun 09 '25 16:06 lsemprini

Thanks!

Neargye avatar Jun 11 '25 16:06 Neargye