diff --git a/include/nameof.hpp b/include/nameof.hpp index 587beb0..5895adf 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -266,10 +266,10 @@ inline constexpr auto nameof_type_v = n(); } // namespace nameof::detail // Checks is nameof_type supported compiler. -inline constexpr auto is_nameof_type_supported = detail::nameof_type_supported::value; +inline constexpr bool is_nameof_type_supported = detail::nameof_type_supported::value; // Checks is nameof_enum supported compiler. -inline constexpr auto is_nameof_enum_supported = detail::nameof_enum_supported::value; +inline constexpr bool is_nameof_enum_supported = detail::nameof_enum_supported::value; // Obtains simple (unqualified) string enum name of enum variable. template diff --git a/test/test.cpp b/test/test.cpp index 78fedbb..fc9ca93 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -89,6 +89,14 @@ struct enum_range { }; } +#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER) +static_assert(nameof::is_nameof_enum_supported, "nameof::nameof_enum: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); +#endif + +#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) +static_assert(nameof::is_nameof_type_supported, "nameof::nameof_type: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); +#endif + SomeStruct struct_var; Long othervar; SomeStruct * ptr_s = &struct_var;