summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-10-23 18:55:45 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-10-23 19:02:39 +0100
commit3e797a3d152b59302365a7c11c5253292cd34ee7 (patch)
treeb9f9423e3216e38221272d8d1ca80215782ebde8 /src/command_manager.hh
parent5eb8989192445b0505933fcdb1c4f489d4bdc7f9 (diff)
centralize bit operation support for enum used as flags
Diffstat (limited to 'src/command_manager.hh')
-rw-r--r--src/command_manager.hh11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/command_manager.hh b/src/command_manager.hh
index 8d0cc957..283fec92 100644
--- a/src/command_manager.hh
+++ b/src/command_manager.hh
@@ -3,6 +3,7 @@
#include "coord.hh"
#include "completion.hh"
+#include "flags.hh"
#include "memoryview.hh"
#include "shell_manager.hh"
#include "parameters_parser.hh"
@@ -28,14 +29,8 @@ enum class CommandFlags
None = 0,
Hidden = 1,
};
-constexpr CommandFlags operator|(CommandFlags lhs, CommandFlags rhs)
-{
- return (CommandFlags)((int)lhs | (int)rhs);
-}
-constexpr bool operator&(CommandFlags lhs, CommandFlags rhs)
-{
- return (bool)((int)lhs & (int)rhs);
-}
+
+template<> struct WithBitOps<CommandFlags> : std::true_type {};
class PerArgumentCommandCompleter
{