introspection: type_string specialisations for strings

This commit is contained in:
Danny Robson 2016-03-14 22:33:22 +11:00
parent 9e9477858b
commit 2786b88bd1
2 changed files with 8 additions and 0 deletions

View File

@ -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[];

View File

@ -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)