We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e37f743 commit 4eecd1dCopy full SHA for 4eecd1d
src/common/Util.hpp
@@ -0,0 +1,7 @@
1
+#pragma once
2
+
3
+#define IMPLEMENT_ENUM_FLAG_OPERATORS(TEnum, TBaseType) \
4
+ inline TEnum operator|(TEnum a, TEnum b) { return (TEnum)((TBaseType)a | (TBaseType)b); } \
5
+ inline TEnum operator&(TEnum a, TEnum b) { return (TEnum)((TBaseType)a & (TBaseType)b); } \
6
+ inline TEnum& operator|=(TEnum& a, TEnum b) { return a = a | b; } \
7
+ inline TEnum& operator&=(TEnum& a, TEnum b) { return a = a & b; }
0 commit comments