From 3e797a3d152b59302365a7c11c5253292cd34ee7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 23 Oct 2014 18:55:45 +0100 Subject: centralize bit operation support for enum used as flags --- src/command_manager.hh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/command_manager.hh') 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 : std::true_type {}; class PerArgumentCommandCompleter { -- cgit v1.2.3