parse/enum: detect types with underlying_type members

This commit is contained in:
Danny Robson 2019-08-29 14:05:39 +10:00
parent 67c682d5a2
commit 1e1aa33b75

View File

@ -33,6 +33,13 @@ namespace cruft::parse::enumeration {
> { using type = std::underlying_type_t<EnumT>; };
template <typename EnumT>
struct underlying_else_identity<
EnumT,
std::void_t<typename EnumT::underlying_type>
> { using type = typename underlying_else_identity<typename EnumT::underlying_type>::type; };
template <typename EnumT>
using underlying_else_identity_t = typename underlying_else_identity<EnumT>::type;