types/description: add a bool specialisation
This commit is contained in:
parent
b5fdedfe5e
commit
a56610e205
@ -20,6 +20,7 @@ cruft::types::operator<< (std::ostream &os, cruft::types::category val)
|
|||||||
case category::UNSIGNED: return os << "UNSIGNED";
|
case category::UNSIGNED: return os << "UNSIGNED";
|
||||||
case category::SIGNED: return os << "SIGNED";
|
case category::SIGNED: return os << "SIGNED";
|
||||||
case category::REAL: return os << "REAL";
|
case category::REAL: return os << "REAL";
|
||||||
|
case category::BOOL: return os << "BOOL";
|
||||||
}
|
}
|
||||||
|
|
||||||
unreachable ();
|
unreachable ();
|
||||||
|
@ -54,6 +54,7 @@ namespace cruft::types {
|
|||||||
UNSIGNED,
|
UNSIGNED,
|
||||||
SIGNED,
|
SIGNED,
|
||||||
REAL,
|
REAL,
|
||||||
|
BOOL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -106,6 +107,8 @@ namespace cruft::types {
|
|||||||
template <> struct category_traits<f32> : public std::integral_constant<category,category::REAL> {};
|
template <> struct category_traits<f32> : public std::integral_constant<category,category::REAL> {};
|
||||||
template <> struct category_traits<f64> : public std::integral_constant<category,category::REAL> {};
|
template <> struct category_traits<f64> : public std::integral_constant<category,category::REAL> {};
|
||||||
|
|
||||||
|
template <> struct category_traits<bool> : public std::integral_constant<category,category::BOOL> {};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr auto category_traits_v = category_traits<T>::value;
|
constexpr auto category_traits_v = category_traits<T>::value;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user