summaryrefslogtreecommitdiff
path: root/src/parameters_parser.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-03-15 17:55:34 +0000
committerMaxime Coste <mawww@kakoune.org>2017-03-15 18:00:58 +0000
commitdb9b863222dbd51154c422cf85bc8fafacd5b25b (patch)
treec64d4a42ff62372736d747a1ab25568954ba6e32 /src/parameters_parser.hh
parenta49e175727928b8b45c0c2ccdb01f143ea6d18c2 (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/parameters_parser.hh')
-rw-r--r--src/parameters_parser.hh3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh
index f45c0410..a790aa6e 100644
--- a/src/parameters_parser.hh
+++ b/src/parameters_parser.hh
@@ -53,6 +53,7 @@ struct ParameterDesc
SwitchesOnlyAtStart = 1,
SwitchesAsPositional = 2,
};
+ friend constexpr bool with_bit_ops(Meta::Type<Flags>) { return true; }
ParameterDesc() = default;
ParameterDesc(SwitchMap switches, Flags flags = Flags::None,
@@ -66,8 +67,6 @@ struct ParameterDesc
size_t max_positionals = -1;
};
-template<> struct WithBitOps<ParameterDesc::Flags> : std::true_type {};
-
// ParametersParser provides tools to parse command parameters.
// There are 3 types of parameters:
// * unnamed options, which are accessed by position (ignoring named ones)