diff options
| author | Maxime Coste <mawww@kakoune.org> | 2017-03-15 17:55:34 +0000 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2017-03-15 18:00:58 +0000 |
| commit | db9b863222dbd51154c422cf85bc8fafacd5b25b (patch) | |
| tree | c64d4a42ff62372736d747a1ab25568954ba6e32 /src/input_handler.hh | |
| parent | a49e175727928b8b45c0c2ccdb01f143ea6d18c2 (diff) | |
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.
Diffstat (limited to 'src/input_handler.hh')
| -rw-r--r-- | src/input_handler.hh | 5 |
1 files changed, 2 insertions, 3 deletions
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<PromptFlags> : std::true_type {}; +constexpr bool with_bit_ops(Meta::Type<PromptFlags>) { return true; } using KeyCallback = std::function<void (Key, Context&)>; @@ -131,8 +131,7 @@ enum class AutoInfo Normal = 1 << 2 }; -template<> -struct WithBitOps<AutoInfo> : std::true_type {}; +constexpr bool with_bit_ops(Meta::Type<AutoInfo>) { return true; } constexpr Array<EnumDesc<AutoInfo>, 3> enum_desc(Meta::Type<AutoInfo>) { |
