1#ifndef _BBM_TYPE_NAME_H_
2#define _BBM_TYPE_NAME_H_
6#if !defined(__clang__) || !defined(__GNUC__) || !defined(__MSC_VER)
20 inline constexpr std::string_view typestring_impl(
void)
23 constexpr auto prefix = std::string_view{
"[T = "};
24 constexpr auto suffix = std::string_view{
"]"};
25 constexpr auto function = std::string_view{__PRETTY_FUNCTION__};
26#elif defined(__GNUC__)
27 constexpr auto prefix = std::string_view{
"with T = "};
28 constexpr auto suffix = std::string_view{
"; "};
29 constexpr auto function = std::string_view{__PRETTY_FUNCTION__};
30#elif defined(__MSC_VER)
31 constexpr auto prefix = std::string_view{
"get_type_name<"};
32 constexpr auto suffix = std::string_view{
">(void)"};
33 constexpr auto function = std::string_view{__FUNCSIG__};
35 constexpr auto prefix = std::string_view{
""};
36 constexpr auto suffix = std::string_view{
""};
37 auto function = std::string_view(
typeid(T{}).name() );
41 const auto start = function.find(prefix) + prefix.size();
42 const auto end = function.find(suffix);
45 return function.substr(start,
size);
51 static constexpr std::string_view
typestring = bbm::detail::typestring_impl<T>();
53 #define toTypestring(...) bbm::typestring<decltype(__VA_ARGS__)>
Definition: aggregatebsdf.h:29
static constexpr std::string_view typestring
Definition: typestring.h:51
auto end(T &&t)
Definition: iterator_util.h:43
size_t size(T &&t)
Definition: iterator_util.h:22