introspection: type_string specialisations for strings
This commit is contained in:
parent
9e9477858b
commit
2786b88bd1
@ -32,3 +32,7 @@ constexpr char util::type_string<uint64_t>::value[];
|
||||
|
||||
constexpr char util::type_string<float>::value[];
|
||||
constexpr char util::type_string<double>::value[];
|
||||
|
||||
constexpr char util::type_string<std::string>::value[];
|
||||
constexpr char util::type_string<char*>::value[];
|
||||
constexpr char util::type_string<char[]>::value[];
|
||||
|
@ -47,6 +47,10 @@ namespace util {
|
||||
template <> struct type_string<float > { static constexpr const char value[] = "float32"; };
|
||||
template <> struct type_string<double > { static constexpr const char value[] = "float64"; };
|
||||
|
||||
template <> struct type_string<std::string> { static constexpr const char value[] = "string"; };
|
||||
template <> struct type_string<char*> { static constexpr const char value[] = "string"; };
|
||||
template <> struct type_string<char[]> { static constexpr const char value[] = "string"; };
|
||||
|
||||
template <typename T>
|
||||
auto
|
||||
to_string (void)
|
||||
|
Loading…
Reference in New Issue
Block a user