31 typename std::enable_if<std::is_integral<T>::value, std::string>::type
33 return std::to_string(in);
37 typename std::enable_if<std::is_floating_point<T>::value
38 && !std::is_same<T, half>::value,
42 std::snprintf(buf, 20,
"%g", in);
43 return std::string(buf);
47 typename std::enable_if<std::is_same<T, half>::value, std::string>::type
49 return numberToRep(static_cast<float>(in));
59 typename std::enable_if<!std::is_arithmetic<T>::value, std::string>::type
60 numberToRep(
const T& in) {
61 return static_cast<std::string
>(in);
65 template <
typename T>
const char* typeCharRep() {
return "?"; }
66 template <> constexpr
const char* typeCharRep<int>() {
return "i"; }
67 template <> constexpr
const char* typeCharRep<unsigned int>() {
return "ui"; }
68 template <> constexpr
const char* typeCharRep<float>() {
return "f"; }
69 template <> constexpr
const char* typeCharRep<double>() {
return "d"; }