mirror of
https://github.com/QuasarApp/QuasarAppLib.git
synced 2025-04-27 02:04:39 +00:00
added !operator for enum classes
This commit is contained in:
parent
ffc95d077b
commit
e634961b4a
11
global.h
11
global.h
@ -74,6 +74,17 @@ constexpr inline T operator ^ (T lhs, T 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.
|
||||
//template <class IntegerType>
|
||||
//constexpr IntegerType static_mul(const char* str, unsigned char depth, unsigned char index = 0) noexcept {
|
||||
|
Loading…
x
Reference in New Issue
Block a user