diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-07-17 10:28:00 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-05-02 08:08:18 +0000 |
commit | 658104687cc018a8de634861c687c37a29ca10ec (patch) | |
tree | d55691124063105542e80c896c98d6ce2a63ed27 /src/generic | |
parent | b5ab3d6d25c024fc120746514edfff33c55074d2 (diff) | |
download | tmwa-underlying_type.tar.gz tmwa-underlying_type.tar.bz2 tmwa-underlying_type.tar.xz tmwa-underlying_type.zip |
Use std::underlying_typeunderlying_type
Since according to the comment, TMWA already depended on GCC 4.7.
Diffstat (limited to 'src/generic')
-rw-r--r-- | src/generic/enum.hpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/generic/enum.hpp b/src/generic/enum.hpp index d5d50ea..07605fb 100644 --- a/src/generic/enum.hpp +++ b/src/generic/enum.hpp @@ -72,19 +72,7 @@ public: } }; -// std::underlying_type isn't supported until gcc 4.7 -// this is a poor man's emulation -// TODO I'm depending on GCC 4.7 now, this can go away -template<class E> -struct underlying_type -{ - static_assert(std::is_enum<E>::value, "Only enums have underlying type!"); - typedef typename std::conditional< - std::is_signed<E>::value, - typename std::make_signed<E>::type, - typename std::make_unsigned<E>::type - >::type type; -}; +using std::underlying_type; template<class E, bool=std::is_enum<E>::value> struct remove_enum |