From b8cb65160acec9531c00b2066a8a574cac1645e6 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 8 Oct 2017 19:56:03 +0800 Subject: [PATCH] Regex: use std::conditional instead of custom template class to choose Utf8It --- src/regex_impl.hh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/regex_impl.hh b/src/regex_impl.hh index 5a294400..3addb2b2 100644 --- a/src/regex_impl.hh +++ b/src/regex_impl.hh @@ -85,18 +85,6 @@ enum class RegexExecFlags constexpr bool with_bit_ops(Meta::Type) { return true; } -template -struct ChooseUtf8It -{ - using Type = utf8::iterator; -}; - -template -struct ChooseUtf8It -{ - using Type = std::reverse_iterator>; -}; - template class ThreadedRegexVM { @@ -217,7 +205,9 @@ private: Saves* saves; }; - using Utf8It = typename ChooseUtf8It::Type; + using Utf8It = std::conditional_t, + std::reverse_iterator>>; enum class StepResult { Consumed, Matched, Failed };