diff --git a/introspection.hpp b/introspection.hpp index e1287468..b0de712c 100644 --- a/introspection.hpp +++ b/introspection.hpp @@ -78,6 +78,26 @@ namespace util { { return type_name_v; } + /////////////////////////////////////////////////////////////////////////// + template + struct type_char; + + template <> struct type_char { static constexpr char value = 'f'; }; + template <> struct type_char { static constexpr char value = 'd'; }; + + template <> struct type_char< int8_t> { static constexpr char value = 'i'; }; + template <> struct type_char< int16_t> { static constexpr char value = 'i'; }; + template <> struct type_char< int32_t> { static constexpr char value = 'i'; }; + template <> struct type_char< int64_t> { static constexpr char value = 'i'; }; + + template <> struct type_char< uint8_t> { static constexpr char value = 'u'; }; + template <> struct type_char { static constexpr char value = 'u'; }; + template <> struct type_char { static constexpr char value = 'u'; }; + template <> struct type_char { static constexpr char value = 'u'; }; + + template + constexpr auto type_char_v = type_char::value; + /////////////////////////////////////////////////////////////////////////// /// Lists valid values of an enumeration ///