From 0ac55f3699da335b3211df1d8033f2f245d2a591 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Fri, 15 Jul 2022 16:37:42 -0700 Subject: [PATCH] Improve build times by not including functional --- include/rexy/detail/algorithm.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/rexy/detail/algorithm.hpp b/include/rexy/detail/algorithm.hpp index 52965ec..edca293 100644 --- a/include/rexy/detail/algorithm.hpp +++ b/include/rexy/detail/algorithm.hpp @@ -22,8 +22,7 @@ #include "../utility.hpp" //swap #include //nothrow_invocable -#include //less, greater -#include //pair +#include //pair, forward #include //iterator_traits #include //size_t @@ -81,10 +80,15 @@ namespace rexy::detail{ } return {max_suffix, period}; } + template constexpr std::pair critical_factorization(const Iter& nstart, const Iter& nend){ - auto msuffix = max_suffix(nstart, nend - nstart, std::less{}); - auto msuffix_rev = max_suffix(nstart, nend - nstart, std::greater{}); + auto msuffix = max_suffix(nstart, nend - nstart, [](T&& left, U&& right) constexpr{ + return std::forward(left) < std::forward(right); + }); + auto msuffix_rev = max_suffix(nstart, nend - nstart, [](T&& left, U&& right) constexpr{ + return std::forward(left) > std::forward(right); + }); if(msuffix.first < msuffix_rev.first){ return msuffix_rev; }