All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
common.h File Reference
#include <string_view>

Go to the source code of this file.

Functions

template<typename T >
constexpr auto type_name ()
 

Function Documentation

template<typename T >
constexpr auto type_name ( )

Definition at line 12 of file common.h.

13 {
14  std::string_view name, prefix, suffix;
15 #ifdef __clang__
16  name = __PRETTY_FUNCTION__;
17  prefix = "auto type_name() [T = ";
18  suffix = "]";
19 #elif defined(__GNUC__)
20  name = __PRETTY_FUNCTION__;
21  prefix = "constexpr auto type_name() [with T = ";
22  suffix = "]";
23 #elif defined(_MSC_VER)
24  name = __FUNCSIG__;
25  prefix = "auto __cdecl type_name<";
26  suffix = ">(void)";
27 #endif
28  name.remove_prefix(prefix.size());
29  name.remove_suffix(suffix.size());
30  return name;
31 }
then echo fcl name