11#pragma once
22
33#include < stdx/compiler.hpp>
4+ #include < stdx/type_traits.hpp>
45
56#include < cstddef>
67#include < string_view>
@@ -9,14 +10,15 @@ namespace stdx {
910inline namespace v1 {
1011template <typename Tag>
1112CONSTEVAL static auto type_as_string () -> std::string_view {
12- #if defined( __clang__)
13+ #ifdef __clang__
1314 constexpr std::string_view function_name = __PRETTY_FUNCTION__;
1415 constexpr auto rhs = function_name.size () - 2 ;
1516#elif defined(__GNUC__) || defined(__GNUG__)
1617 constexpr std::string_view function_name = __PRETTY_FUNCTION__;
1718 constexpr auto rhs = function_name.size () - 51 ;
1819#else
19- static_assert (false , " Unknown compiler, can't build type name." );
20+ static_assert (always_false_v<Tag>,
21+ " Unknown compiler, can't build type name." );
2022#endif
2123
2224 constexpr auto lhs = function_name.rfind (' =' , rhs) + 2 ;
@@ -25,14 +27,15 @@ CONSTEVAL static auto type_as_string() -> std::string_view {
2527
2628template <auto Value>
2729CONSTEVAL static auto enum_as_string () -> std::basic_string_view<char> {
28- #if defined( __clang__)
30+ #ifdef __clang__
2931 constexpr std::string_view value_string = __PRETTY_FUNCTION__;
3032 constexpr auto rhs = value_string.size () - 2 ;
3133#elif defined(__GNUC__) || defined(__GNUG__)
3234 constexpr std::string_view value_string = __PRETTY_FUNCTION__;
3335 constexpr auto rhs = value_string.size () - 2 ;
3436#else
35- static_assert (false , " Unknown compiler, can't build type name." );
37+ static_assert (always_false_v<Tag>,
38+ " Unknown compiler, can't build type name." );
3639#endif
3740
3841 constexpr auto lhs = [&]() -> std::string_view::size_type {
0 commit comments