summaryrefslogtreecommitdiff
path: root/src/utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2018-10-10 22:35:38 +1100
committerMaxime Coste <mawww@kakoune.org>2018-10-10 22:47:59 +1100
commitd652ec9ce1f6bebeeadec92348d1f756f03cff32 (patch)
tree2fff726e3ea8433b27e79d5fc0d2231dab278771 /src/utils.hh
parent9024d41d64627fd6a59b5ad66987e11e2d228f16 (diff)
Cleanup regex lookarounds implementation and reject incompatible regex
Fixes #2487
Diffstat (limited to 'src/utils.hh')
-rw-r--r--src/utils.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils.hh b/src/utils.hh
index f21be9c1..ec6965a8 100644
--- a/src/utils.hh
+++ b/src/utils.hh
@@ -148,6 +148,12 @@ bool skip_while_reverse(Iterator& it, const BeginIterator& begin, T condition)
return condition(*it);
}
+template<typename E>
+auto to_underlying(E value)
+{
+ return static_cast<std::underlying_type_t<E>>(value);
+}
+
}
#endif // utils_hh_INCLUDED