diff --git a/include/ctre/evaluation.hpp b/include/ctre/evaluation.hpp index 6701c6fa..c0bdcf81 100644 --- a/include/ctre/evaluation.hpp +++ b/include/ctre/evaluation.hpp @@ -136,11 +136,9 @@ constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, c // matching select in patterns template constexpr CTRE_FORCE_INLINE R evaluate(const Iterator begin, Iterator current, const EndIterator end, const flags & f, R captures, ctll::list, Tail...>) noexcept { - if (auto r = evaluate(begin, current, end, f, captures, ctll::list())) { - return r; - } else { - return evaluate(begin, current, end, f, captures, ctll::list, Tail...>()); - } + R inner_result = evaluate(begin, current, end, f, captures, ctll::list()); //first branch + ((!inner_result && (inner_result = evaluate(begin, current, end, f, captures, ctll::list()))), ...); //all others + return inner_result; } template