From db9b863222dbd51154c422cf85bc8fafacd5b25b Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 15 Mar 2017 17:55:34 +0000 Subject: Migrate WithBitOps template specialization to with_bit_ops function This way we dont depend on knowing the base template to enable bit ops on an enum type. --- src/input_handler.hh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/input_handler.hh') diff --git a/src/input_handler.hh b/src/input_handler.hh index fd13a5a0..2962ac12 100644 --- a/src/input_handler.hh +++ b/src/input_handler.hh @@ -35,7 +35,7 @@ enum class PromptFlags Password = 1 << 0, DropHistoryEntriesWithBlankPrefix = 1 << 1 }; -template<> struct WithBitOps : std::true_type {}; +constexpr bool with_bit_ops(Meta::Type) { return true; } using KeyCallback = std::function; @@ -131,8 +131,7 @@ enum class AutoInfo Normal = 1 << 2 }; -template<> -struct WithBitOps : std::true_type {}; +constexpr bool with_bit_ops(Meta::Type) { return true; } constexpr Array, 3> enum_desc(Meta::Type) { -- cgit v1.2.3