diff --git a/src/main.cc b/src/main.cc index cbff8402..fe697e1b 100644 --- a/src/main.cc +++ b/src/main.cc @@ -335,18 +335,23 @@ private: template Repeated repeated(T func) { return Repeated(func); } -namespace SelectFlags +enum class SelectFlags { - enum Type - { - None = 0, - Reverse = 1, - Inclusive = 2, - Extend = 4 - }; + None = 0, + Reverse = 1, + Inclusive = 2, + Extend = 4 +}; +constexpr SelectFlags operator|(SelectFlags lhs, SelectFlags rhs) +{ + return (SelectFlags)((int) lhs | (int) rhs); +} +constexpr bool operator&(SelectFlags lhs, SelectFlags rhs) +{ + return ((int) lhs & (int) rhs) != 0; } -template +template void select_to_next_char(Context& context) { int param = context.numeric_param();