From c98f8746877168736a04990ce5b3156aa5ef6799 Mon Sep 17 00:00:00 2001 From: Marc Date: Sat, 22 Apr 2023 20:16:48 +0200 Subject: [PATCH] Removed type alias in template --- include/Lz/FunctionTools.hpp | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/include/Lz/FunctionTools.hpp b/include/Lz/FunctionTools.hpp index ddd2b9dd..9f78bff4 100644 --- a/include/Lz/FunctionTools.hpp +++ b/include/Lz/FunctionTools.hpp @@ -302,8 +302,9 @@ LZ_NODISCARD LZ_CONSTEXPR_CXX_20 Zip pairwise(Iterator begin * @param iterable A container/iterable. * @return A zip iterator that accesses two adjacent elements of one container. */ -template> -LZ_NODISCARD LZ_CONSTEXPR_CXX_20 Zip pairwise(Iterable&& iterable) { +template +LZ_NODISCARD LZ_CONSTEXPR_CXX_20 Zip, internal::IterTypeFromIterable> +pairwise(Iterable&& iterable) { return lz::pairwise(internal::begin(std::forward(iterable)), internal::end(std::forward(iterable))); } @@ -464,12 +465,10 @@ select(Iterator begin, Iterator end, SelectorIterator beginSelector, SelectorIte * @param execution The `std::execution` policy. * @return A map object that can be iterated over with the excluded elements that `selectors` specify. */ -template, - class SelectorIterator = internal::IterTypeFromIterable> +template LZ_NODISCARD LZ_CONSTEXPR_CXX_20 -Map, internal::GetFn<1>, Execution>, - internal::GetFn<0>> +Map, + internal::IterTypeFromIterable>, internal::GetFn<1>, Execution>, internal::GetFn<0>> select(Iterable&& iterable, SelectorIterable&& selectors, Execution execution = std::execution::seq) { return lz::select(internal::begin(std::forward(iterable)), internal::end(std::forward(iterable)), internal::begin(std::forward(selectors)), @@ -726,7 +725,8 @@ findLastOrDefaultIf(Iterator begin, Iterator end, UnaryPredicate predicate, cons Execution execution = std::execution::seq) { std::reverse_iterator endReverse(std::move(end)); std::reverse_iterator beginReverse(std::move(begin)); - return lz::findFirstOrDefaultIf(std::move(endReverse), std::move(beginReverse), std::move(predicate), defaultValue, execution); + return lz::findFirstOrDefaultIf(std::move(endReverse), std::move(beginReverse), std::move(predicate), defaultValue, + execution); } /** @@ -1223,7 +1223,8 @@ bool startsWith(IteratorA beginA, IteratorA endA, IteratorB beginB, IteratorB en return std::search(std::move(beginA), std::move(endA), std::move(beginB), std::move(endB), std::move(compare)) != endA; } -template)> +template)> bool startsWith(const IterableA& a, const IterableB& b, BinaryPredicate compare = {}) { return lz::startsWith(std::begin(a), std::end(a), std::begin(b), std::end(b), std::move(compare)); } @@ -1237,7 +1238,8 @@ bool endsWith(IteratorA beginA, IteratorA endA, IteratorB beginB, IteratorB endB return lz::startsWith(std::move(revBegA), std::move(revEndA), std::move(revBegB), std::move(revEndB), std::move(compare)); } -template)> +template)> bool endsWith(const IterableA& a, const IterableB& b, BinaryPredicate compare = {}) { return lz::endsWith(std::begin(a), std::end(a), std::begin(b), std::end(b), std::move(compare)); } @@ -1297,9 +1299,9 @@ select(Iterator begin, Iterator end, SelectorIterator beginSelector, SelectorIte * @param selectors The selectors that specifies to select an item in `iterable` yes or no. * @return A map object that can be iterated over with the excluded elements that `selectors` specify. */ -template, - class SelectorIterator = internal::IterTypeFromIterable> -Map, internal::GetFn<1>>, internal::GetFn<0>> +template +Map, + internal::IterTypeFromIterable>, internal::GetFn<1>>, internal::GetFn<0>> select(Iterable&& iterable, SelectorIterable&& selectors) { return lz::select(internal::begin(std::forward(iterable)), internal::end(std::forward(iterable)), internal::begin(std::forward(selectors)),