From 270e82f16fcded7b5e5ef7a312598719f58fcad1 Mon Sep 17 00:00:00 2001 From: Donald Linton Date: Thu, 23 Jan 2020 14:17:49 -0500 Subject: [PATCH] add is_enum to insure that bit shifts are not mistaken for io stream operators --- src/lib/TypeTraits.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/TypeTraits.h b/src/lib/TypeTraits.h index aaa26fe..ad44f67 100644 --- a/src/lib/TypeTraits.h +++ b/src/lib/TypeTraits.h @@ -106,6 +106,8 @@ template < typename T, typename U > struct is_same : false_type{}; template < typename T > struct is_same< T, T > : true_type{}; + template struct is_enum : public integral_constant{}; + template< typename T > struct is_integer{ enum{ @@ -232,6 +234,7 @@ template struct is_base_of::value && + !is_enum::value && !is_fundamental::value && !is_pointer::value>::type >{ @@ -245,7 +248,8 @@ template struct is_base_of::value || - is_fundamental::value || + is_enum::value || + is_fundamental::value|| is_pointer::value>::type >{ static const bool value = 0;