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

error: cannot convert magic_enum::detail::enable_if_t #337

Closed cezaryece closed 9 months ago

cezaryece commented 9 months ago

OS Linux(amd64) v6.5.0-17-generic GCC-12 magic_enum ersion 0.9.5

error: cannot convert ‘magic_enum::detail::enable_if_t<FieldTypesSE, std::optional, magic_enum::detail::case_insensitive<>, FieldTypesSE>’ {aka ‘std::optional’} to ‘FieldTypesSE’ in return 296 return magic_enum::enum_cast(nameStd, magic_enum::case_insensitive); } ~~~~~^~~~~~~~~
magic_enum::detail::enable_if_t<FieldTypesSE, std::optional, magic_enum::detail::case_insensitive<>, FieldTypesSE> {aka std::optional}

enum FieldTypesSE : int { //search events SE_FOOTBALL = 1, SE_VOLLEYBALL, SE_BASKETBALL, //... SE_OTHER = 0, };

cezaryece commented 9 months ago

OK, seems I dotn understood how it works, examples clear it.