diff --git a/include/nameof.hpp b/include/nameof.hpp index 4dc75c6..2117c9e 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -251,9 +251,15 @@ template return detail::nameof_enum_impl(); } -// Obtains string name of type. +// Obtains string name of type, reference and cv-qualifiers are ignored. template [[nodiscard]] constexpr std::string_view nameof_type() noexcept { + return detail::nameof_type_impl>>>(); +} + +// Obtains string name of full type, with reference and cv-qualifiers. +template +[[nodiscard]] constexpr std::string_view nameof_full_type() noexcept { return detail::nameof_type_impl>(); } @@ -275,10 +281,16 @@ template // This version is much lighter on the compile times and is not restricted to the enum_range limitation. #define NAMEOF_CONST_ENUM(...) ::nameof::nameof_enum<__VA_ARGS__>() -// Obtains string name of type. +// Obtains string name of type, reference and cv-qualifiers are ignored. #define NAMEOF_TYPE(...) ::nameof::nameof_type<__VA_ARGS__>() -// Obtains string name of variable type. -#define NAMEOF_VAR_TYPE(...) ::nameof::nameof_type() +// Obtains string name of full type, with reference and cv-qualifiers. +#define NAMEOF_FULL_TYPE(...) ::nameof::nameof_full_type<__VA_ARGS__>() + +// Obtains string name type of expression, reference and cv-qualifiers are ignored. +#define NAMEOF_TYPE_EXPR(...) ::nameof::nameof_type() + +// Obtains string name full type of expression, with reference and cv-qualifiers. +#define NAMEOF_FULL_TYPE_EXPR(...) ::nameof::nameof_full_type() #endif // NEARGYE_NAMEOF_HPP