Skip to content
Snippets Groups Projects
Commit 777cb9fc authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[stl] add support for is_enum and underlying_type type traits

parent 3b353b7f
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@ namespace std {
template <class T> struct is_rvalue_reference;
template <class T> struct is_member_object_pointer;
template <class T> struct is_member_function_pointer;
template <class T> struct is_enum;
template <class T> struct is_enum: public __boolean<__is_enum(T)>{};
template <class T> struct is_union;
// see https://en.cppreference.com/w/cpp/types/is_class
......@@ -282,9 +282,14 @@ namespace std {
// helper types
template< bool B, class T, class F >
using conditional_t = typename conditional<B,T,F>::type;
template <class... T> struct common_type;
template <class T> struct underlying_type;
template <bool, class T> struct __underlying_type_t {};
template <class T> struct __underlying_type_t<true, T> {
typedef __underlying_type(T) type;
};
template <class T>
struct underlying_type: __underlying_type_t<is_enum<T>::value,T> {};
template <class> class result_of;
template <class F, class... ArgTypes> class result_of<F(ArgTypes...)> {
public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment