fix is_nameof_*_supported

This commit is contained in:
neargye 2019-08-27 19:54:16 +05:00
parent d74130477e
commit a267cc70d7
2 changed files with 10 additions and 2 deletions

View file

@ -266,10 +266,10 @@ inline constexpr auto nameof_type_v = n<T>();
} // namespace nameof::detail } // namespace nameof::detail
// Checks is nameof_type supported compiler. // Checks is nameof_type supported compiler.
inline constexpr auto is_nameof_type_supported = detail::nameof_type_supported<void>::value; inline constexpr bool is_nameof_type_supported = detail::nameof_type_supported<void>::value;
// Checks is nameof_enum supported compiler. // Checks is nameof_enum supported compiler.
inline constexpr auto is_nameof_enum_supported = detail::nameof_enum_supported<void>::value; inline constexpr bool is_nameof_enum_supported = detail::nameof_enum_supported<void>::value;
// Obtains simple (unqualified) string enum name of enum variable. // Obtains simple (unqualified) string enum name of enum variable.
template <typename E> template <typename E>

View file

@ -89,6 +89,14 @@ struct enum_range<number> {
}; };
} }
#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; SomeStruct struct_var;
Long othervar; Long othervar;
SomeStruct * ptr_s = &struct_var; SomeStruct * ptr_s = &struct_var;