diff --git a/sprout/utility/until_loop.hpp b/sprout/utility/until_loop.hpp index 9d477e03..fe760385 100644 --- a/sprout/utility/until_loop.hpp +++ b/sprout/utility/until_loop.hpp @@ -12,7 +12,6 @@ #include namespace sprout { -#ifdef SPROUT_CONFIG_DISABLE_CXX14_CONSTEXPR namespace detail { template inline SPROUT_CONSTEXPR sprout::pair @@ -60,21 +59,20 @@ namespace sprout { typedef sprout::pair type; return sprout::detail::until_loop_impl(type(init, false), pred, unary_op, 1).second; } -#else + // - // until_loop + // flat_until_loop // // recursion depth: // 0 // template inline SPROUT_CXX14_CONSTEXPR T - until_loop(T init, Predicate pred, UnaryOperation unary_op) { + flat_until_loop(T init, Predicate pred, UnaryOperation unary_op) { for (; !pred(init); init = unary_op(init)) ; return init; } -#endif } // namespace sprout #endif // #ifndef SPROUT_UTILITY_UNTIL_LOOP_HPP diff --git a/sprout/utility/while_loop.hpp b/sprout/utility/while_loop.hpp index 9a0884d0..915ec623 100644 --- a/sprout/utility/while_loop.hpp +++ b/sprout/utility/while_loop.hpp @@ -12,7 +12,6 @@ #include namespace sprout { -#ifdef SPROUT_CONFIG_DISABLE_CXX14_CONSTEXPR namespace detail { template inline SPROUT_CONSTEXPR sprout::pair @@ -60,21 +59,20 @@ namespace sprout { typedef sprout::pair type; return sprout::detail::while_loop_impl(type(init, false), pred, unary_op, 1).second; } -#else + // - // while_loop + // flat_while_loop // // recursion depth: // 0 // template inline SPROUT_CXX14_CONSTEXPR T - while_loop(T init, Predicate pred, UnaryOperation unary_op) { + flat_while_loop(T init, Predicate pred, UnaryOperation unary_op) { for (; pred(init); init = unary_op(init)) ; return init; } -#endif } // namespace sprout #endif // #ifndef SPROUT_UTILITY_WHILE_LOOP_HPP