remove the !operator for enum classes it is not secure

This commit is contained in:
Andrei Yankovich 2020-12-27 16:26:42 +03:00
parent 2934cdc09f
commit 7106ed22d9

View File

@ -74,16 +74,6 @@ constexpr inline T operator ^ (T lhs, T rhs)
return static_cast<T>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return static_cast<T>(static_cast<int>(lhs) ^ static_cast<int>(rhs));
} }
template <typename T>
constexpr inline bool operator ! (T lhs)
{
static_assert(std::is_enum<T>::value,
"template parameter is not an enum type");
return !static_cast<bool>(lhs);
}
// TO DO need to testing. I am think this is does not work. // TO DO need to testing. I am think this is does not work.
//template <class IntegerType> //template <class IntegerType>