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.99k stars 445 forks source link

Argument-dependent lookup results in `invoke_r` ambiguity #299

Closed ZeroMemes closed 1 year ago

ZeroMemes commented 1 year ago

When using MSVC with /std:c++latest, magic_enum::detail::constexpr_switch_impl's call to magic_enum::detail::invoke_r is deemed ambiguous with std::invoke_r due to argument-dependent lookup via std::forward.

This error doesn't happen on Clang or GCC when using libc++, but does happen on Clang when using the Microsoft STL.

https://godbolt.org/z/Ksscz6azE

Neargye commented 1 year ago

fix in master