mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-27 02:04:39 +00:00
remove the !operator for enum classes it is not secure
This commit is contained in:
parent
2934cdc09f
commit
7106ed22d9
10
global.h
10
global.h
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user