4#ifndef GREM_CORE_ALGORITHMS_HPP
5#define GREM_CORE_ALGORITHMS_HPP
23 template <
typename A,
typename B>
24 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) == std::forward<B>(b)) {
25 return std::forward<A>(a) == std::forward<B>(b);
31 template <
typename A,
typename B>
32 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) != std::forward<B>(b)) {
33 return std::forward<A>(a) != std::forward<B>(b);
39 template <
typename A,
typename B>
40 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) < std::forward<B>(b)) {
41 return std::forward<A>(a) < std::forward<B>(b);
47 template <
typename A,
typename B>
48 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) <= std::forward<B>(b)) {
49 return std::forward<A>(a) <= std::forward<B>(b);
55 template <
typename A,
typename B>
56 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) > std::forward<B>(b)) {
57 return std::forward<A>(a) > std::forward<B>(b);
63 template <
typename A,
typename B>
64 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) >= std::forward<B>(b)) {
65 return std::forward<A>(a) >= std::forward<B>(b);
71 template <
typename A,
typename B>
72 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) + std::forward<B>(b)) {
73 return std::forward<A>(a) + std::forward<B>(b);
79 template <
typename A,
typename B>
80 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) - std::forward<B>(b)) {
81 return std::forward<A>(a) - std::forward<B>(b);
87 template <
typename A,
typename B>
88 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) * std::forward<B>(b)) {
89 return std::forward<A>(a) * std::forward<B>(b);
95 template <
typename A,
typename B>
96 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) / std::forward<B>(b)) {
97 return std::forward<A>(a) / std::forward<B>(b);
103 template <
typename A,
typename B>
104 [[nodiscard]]
constexpr auto operator()(A&& a, B&& b)
const ->
decltype(std::forward<A>(a) % std::forward<B>(b)) {
105 return std::forward<A>(a) % std::forward<B>(b);
111 template <
typename A>
112 [[nodiscard]]
constexpr auto operator()(A&& a)
const ->
decltype(-std::forward<A>(a)) {
113 return -std::forward<A>(a);
123 [[nodiscard]]
constexpr size_t operator()(
const T& value)
const {
124 return hasher(value);
128 [[no_unique_address]] std::hash<T> hasher;
136 [[nodiscard]]
constexpr size_t operator()(
const T& a,
const T& b)
const {
142 ((hash ^= std::size_t{otherHashes} + (hash << 6) + (hash >> 2)), ...);
146template <
typename T,
typename... Ts>
147[[nodiscard]]
constexpr std::size_t
getHash(
const T& value,
const Ts&... otherValues) {
148 return combineHashes(std::hash<T>{}(value), std::hash<Ts>{}(otherValues)...);
152 auto it = std::begin(
range);
153 auto end = std::end(
range);
155 std::size_t result =
getHash(*it++);
170 auto itA = std::begin(rangeA);
171 auto endA = std::end(rangeA);
172 auto itB = std::begin(rangeB);
173 auto endB = std::end(rangeB);
174 while (itA != endA && itB != endB) {
182 std::for_each(std::begin(
range), std::end(
range), std::move(operation));
186 return std::transform(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(transformationFunction));
190 auto itA = std::begin(rangeA);
191 auto endA = std::end(rangeA);
192 auto itB = std::begin(rangeB);
193 auto endB = std::end(rangeB);
194 while (itA != endA && itB != endB) {
195 *outputIterator++ = std::invoke(transformationFunction, *itA, *itB);
199 return outputIterator;
203 return std::accumulate(std::begin(
range), std::end(
range), std::move(initialValue));
207 return std::accumulate(std::begin(
range), std::end(
range), std::move(initialValue), std::move(reductionFunction));
211 return std::reduce(std::begin(
range), std::end(
range));
215 return std::reduce(std::begin(
range), std::end(
range), std::move(initialValue));
219 return std::reduce(std::begin(
range), std::end(
range), std::move(initialValue), std::move(reductionFunction));
223 return std::any_of(std::begin(
range), std::end(
range), std::move(predicate));
227 return std::all_of(std::begin(
range), std::end(
range), std::move(predicate));
231 return std::none_of(std::begin(
range), std::end(
range), std::move(predicate));
235 return std::count(std::begin(
range), std::end(
range), value);
239 return std::count_if(std::begin(
range), std::end(
range), std::move(predicate));
243 return std::find(std::begin(
range), std::end(
range), value);
246template <auto Member>
248 return std::find_if(std::begin(
range), std::end(
range), [&](
const auto& element) ->
bool {
return element.*Member == value; });
252 return std::find_if(std::begin(
range), std::end(
range), std::move(predicate));
256 return std::find_if_not(std::begin(
range), std::end(
range), std::move(predicate));
260 return std::find_first_of(std::begin(
range), std::end(
range), std::begin(values), std::end(values));
264 return std::find_first_of(std::begin(
range), std::end(
range), std::begin(values), std::end(values), std::move(
equal));
268 return std::find_end(std::begin(
range), std::end(
range), std::begin(values), std::end(values));
272 return std::find_end(std::begin(
range), std::end(
range), std::begin(values), std::end(values), std::move(
equal));
276 return std::search(std::begin(
range), std::end(
range), std::begin(sequence), std::end(sequence));
280 return std::search(std::begin(
range), std::end(
range), std::begin(sequence), std::end(sequence), std::move(
equal));
284 return std::mismatch(std::begin(
range), std::end(
range), std::begin(sequence), std::end(sequence));
288 return std::mismatch(std::begin(
range), std::end(
range), std::begin(sequence), std::end(sequence), std::move(
equal));
292 return std::adjacent_find(std::begin(
range), std::end(
range));
296 return std::adjacent_find(std::begin(
range), std::end(
range), std::move(
equal));
300 auto end = std::end(
range);
301 return std::find(std::begin(
range), end, value) != end;
304template <auto Member>
306 auto end = std::end(
range);
307 return std::find_if(std::begin(
range), end, [&](
const auto& element) ->
bool {
return element.*Member == value; }) != end;
311 auto end = std::end(
range);
312 return std::find_if(std::begin(
range), end, [&](
const auto& v) ->
bool {
return std::invoke(
equal, v, value); }) != end;
316 auto sequenceBegin = std::begin(sequence);
317 auto sequenceEnd = std::end(sequence);
318 if (sequenceBegin == sequenceEnd) {
321 auto end = std::end(
range);
322 return std::search(std::begin(
range), end, std::begin(sequence), std::move(sequenceBegin), std::move(sequenceEnd)) != end;
326 auto sequenceBegin = std::begin(sequence);
327 auto sequenceEnd = std::end(sequence);
328 if (sequenceBegin == sequenceEnd) {
331 auto end = std::end(
range);
332 return std::search(std::begin(
range), end, std::begin(sequence), std::move(sequenceBegin), std::move(sequenceEnd), std::move(
equal)) != end;
336 auto sequenceEnd = std::end(sequence);
337 return std::mismatch(std::begin(
range), std::end(
range), std::begin(sequence), std::begin(sequence), sequenceEnd).second == sequenceEnd;
341 auto sequenceEnd = std::end(sequence);
342 return std::mismatch(std::begin(
range), std::end(
range), std::begin(sequence), std::begin(sequence), sequenceEnd, std::move(
equal)).second == sequenceEnd;
346 const auto rangeSize = std::size(
range);
347 const auto sequenceSize = std::size(sequence);
348 return sequenceSize <= rangeSize && std::equal(std::next(std::begin(
range), (rangeSize - sequenceSize)), std::end(
range), std::begin(sequence), std::end(sequence));
352 const auto rangeSize = std::size(
range);
353 const auto sequenceSize = std::size(sequence);
354 return sequenceSize <= rangeSize &&
355 std::equal(std::next(std::begin(
range), (rangeSize - sequenceSize)), std::end(
range), std::begin(sequence), std::end(sequence), std::move(
equal));
359 return std::equal(std::begin(rangeA), std::end(rangeA), std::begin(rangeB), std::end(rangeB));
363 return std::equal(std::begin(rangeA), std::end(rangeA), std::begin(rangeB), std::end(rangeB), std::move(
equal));
367 return std::lexicographical_compare(std::begin(rangeA), std::end(rangeA), std::begin(rangeB), std::end(rangeB));
371 return std::lexicographical_compare(std::begin(rangeA), std::end(rangeA), std::begin(rangeB), std::end(rangeB), std::move(compare));
375 return std::min_element(std::begin(
range), std::end(
range));
379 return std::min_element(std::begin(
range), std::end(
range), std::move(compare));
383 return std::max_element(std::begin(
range), std::end(
range));
387 return std::max_element(std::begin(
range), std::end(
range), std::move(compare));
391 return std::minmax_element(std::begin(
range), std::end(
range));
395 return std::minmax_element(std::begin(
range), std::end(
range), std::move(compare));
399 return std::is_sorted(std::begin(
range), std::end(
range));
403 return std::is_sorted(std::begin(
range), std::end(
range), std::move(compare));
407 return std::is_partitioned(std::begin(
range), std::end(
range), std::move(compare));
411 return std::includes(std::begin(sortedRange), std::end(sortedRange), std::begin(sortedSequence), std::end(sortedSequence));
415 return std::includes(std::begin(sortedRange), std::end(sortedRange), std::begin(sortedSequence), std::end(sortedSequence), std::move(compare));
419 return std::binary_search(std::begin(sortedRange), std::end(sortedRange), value);
423 return std::binary_search(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
431 return std::lower_bound(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
433 if constexpr (
convertible_to<
typename std::iterator_traits<
decltype(std::begin(sortedRange))>::iterator_category, std::random_access_iterator_tag>) {
434 auto it = std::begin(sortedRange);
435 auto n = std::end(sortedRange) - it;
440 const auto middle = n / 2;
441 if (compare(it[middle], value)) {
446 return (compare(*it, value)) ? it + 1 : it;
448 return std::lower_bound(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
458 return std::upper_bound(std::begin(sortedRange), std::end(sortedRange), value);
462 return std::upper_bound(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
467 auto [begin, end] = std::equal_range(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
468 return Pair{std::move(begin), std::move(end)};
470 if constexpr (
convertible_to<
typename std::iterator_traits<
decltype(std::begin(sortedRange))>::iterator_category, std::random_access_iterator_tag>) {
471 auto begin =
lowerBound(std::forward<
decltype(sortedRange)>(sortedRange), value, compare);
472 auto end = std::upper_bound(begin, std::end(sortedRange), value, std::move(compare));
473 return Pair{std::move(begin), std::move(end)};
475 const auto [begin, end] = std::equal_range(std::begin(sortedRange), std::end(sortedRange), value, std::move(compare));
476 return Pair{std::move(begin), std::move(end)};
486 return std::partition_point(std::begin(partitionedRange), std::end(partitionedRange), std::move(compare));
490 return std::merge(std::begin(sortedRangeA), std::end(sortedRangeA), std::begin(sortedRangeB), std::end(sortedRangeB), std::move(outputIterator));
494 return std::merge(std::begin(sortedRangeA), std::end(sortedRangeA), std::begin(sortedRangeB), std::end(sortedRangeB), std::move(outputIterator), std::move(compare));
498 return std::inplace_merge(std::begin(sortedRange), std::move(middleIterator), std::end(sortedRange));
502 return std::inplace_merge(std::begin(sortedRange), std::move(middleIterator), std::end(sortedRange), std::move(compare));
506 std::sort(std::begin(
range), std::end(
range));
510 std::sort(std::begin(
range), std::end(
range), std::move(compare));
513template <
auto... Members>
515 std::sort(std::begin(
range), std::end(
range), [](
const auto& a,
const auto& b) ->
bool {
return (a.*....*Members) < (b.*....*Members); });
518template <
auto... Members>
520 std::sort(std::begin(
range), std::end(
range), [](
const auto& a,
const auto& b) ->
bool {
return (a.*....*Members) > (b.*....*Members); });
524 std::stable_sort(std::begin(
range), std::end(
range));
528 std::stable_sort(std::begin(
range), std::end(
range), std::move(compare));
531template <
auto... Members>
533 std::stable_sort(std::begin(
range), std::end(
range), [](
const auto& a,
const auto& b) ->
bool {
return (a.*....*Members) < (b.*....*Members); });
536template <
auto... Members>
538 std::stable_sort(std::begin(
range), std::end(
range), [](
const auto& a,
const auto& b) ->
bool {
return (a.*....*Members) > (b.*....*Members); });
542 std::partial_sort(std::begin(
range), middleIterator, std::end(
range));
546 std::partial_sort(std::begin(
range), middleIterator, std::end(
range), std::move(compare));
550 return std::partial_sort_copy(std::begin(
range), std::end(
range), std::begin(outputRange), std::end(outputRange));
554 return std::partial_sort_copy(std::begin(
range), std::end(
range), std::begin(outputRange), std::end(outputRange), std::move(compare));
558 return std::partition(std::begin(
range), std::end(
range), std::move(predicate));
562 return std::stable_partition(std::begin(
range), std::end(
range), std::move(predicate));
566 return std::partition_copy(std::begin(
range), std::end(
range), std::move(trueOutputIterator), std::move(falseOutputIterator), std::move(predicate));
570 return std::nth_element(std::begin(
range), std::move(nthIterator), std::end(
range));
574 return std::nth_element(std::begin(
range), std::move(nthIterator), std::end(
range), std::move(compare));
578 return std::unique(std::begin(
range), std::end(
range));
582 return std::unique(std::begin(
range), std::end(
range), std::move(
equal));
586 return std::unique_copy(std::begin(
range), std::end(
range), std::move(outputIterator));
590 return std::unique_copy(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(
equal));
594 return std::remove(std::begin(
range), std::end(
range), value);
598 return std::remove_if(std::begin(
range), std::end(
range), std::move(predicate));
602 return std::remove_copy(std::begin(
range), std::end(
range), std::move(outputIterator), value);
606 return std::remove_copy_if(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(predicate));
610 return std::replace(std::begin(
range), std::end(
range), oldValue, newValue);
614 return std::replace_if(std::begin(
range), std::end(
range), std::move(predicate), newValue);
618 return std::replace_copy(std::begin(
range), std::end(
range), std::move(outputIterator), oldValue, newValue);
622 return std::replace_copy_if(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(predicate), newValue);
626 std::shuffle(std::begin(
range), std::end(
range), std::forward<
decltype(uniformRandomBitGenerator)>(uniformRandomBitGenerator));
630 return std::sample(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(n), std::forward<
decltype(uniformRandomBitGenerator)>(uniformRandomBitGenerator));
634 std::reverse(std::begin(
range), std::end(
range));
638 return std::reverse_copy(std::begin(
range), std::end(
range), std::move(outputIterator));
642 return std::rotate(std::begin(
range), std::move(middle), std::end(
range));
646 return std::rotate_copy(std::begin(
range), std::move(middle), std::end(
range), std::move(outputIterator));
650 return std::shift_left(std::begin(
range), std::end(
range), n);
654 return std::shift_right(std::begin(
range), std::end(
range), n);
658 return std::copy(std::begin(
range), std::end(
range), std::move(outputIterator));
662 return std::copy_if(std::begin(
range), std::end(
range), std::move(outputIterator), std::move(predicate));
666 return std::copy_backward(std::begin(
range), std::end(
range), std::move(outputEnd));
670 return std::move(std::begin(
range), std::end(
range), std::move(outputIterator));
674 return std::move_backward(std::begin(
range), std::end(
range), std::move(outputEnd));
678 std::fill(std::begin(
range), std::end(
range), value);
682 std::iota(std::begin(
range), std::end(
range), std::move(firstValue));
Definition algorithms.hpp:132
void is_transparent
Definition algorithms.hpp:134
constexpr size_t operator()(const T &a, const T &b) const
Definition algorithms.hpp:136
Definition algorithms.hpp:119
constexpr size_t operator()(const T &value) const
Definition algorithms.hpp:123
void is_transparent
Definition algorithms.hpp:121
Definition concepts.hpp:258
Definition concepts.hpp:47
Definition concepts.hpp:255
Definition concepts.hpp:261
Definition concepts.hpp:243
constexpr auto reverseCopy(bidirectional_range auto &&range, auto outputIterator)
Definition algorithms.hpp:637
constexpr auto findBy(input_range auto &&range, const auto &value)
Definition algorithms.hpp:247
constexpr void sortByDescending(random_access_range auto &&range)
Definition algorithms.hpp:519
constexpr bool anyOf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:222
constexpr auto partition(forward_range auto &&range, auto predicate)
Definition algorithms.hpp:557
constexpr Add ADD
Definition algorithms.hpp:76
constexpr bool lexicographicalCompare(input_range auto &&rangeA, input_range auto &&rangeB)
Definition algorithms.hpp:366
constexpr auto find(input_range auto &&range, const auto &value)
Definition algorithms.hpp:242
constexpr auto shiftRight(forward_range auto &&range, auto n)
Definition algorithms.hpp:653
constexpr auto unique(forward_range auto &&range)
Definition algorithms.hpp:577
constexpr bool endsWith(input_range auto &&range, input_range auto &&sequence)
Definition algorithms.hpp:345
constexpr Subtract SUBTRACT
Definition algorithms.hpp:84
constexpr auto removeCopyIf(input_range auto &&range, auto outputIterator, auto predicate)
Definition algorithms.hpp:605
constexpr bool binarySearch(forward_range auto &&sortedRange, const auto &value)
Definition algorithms.hpp:418
constexpr auto count(input_range auto &&range, const auto &value)
Definition algorithms.hpp:234
constexpr Negate NEGATE
Definition algorithms.hpp:116
constexpr void stableSort(random_access_range auto &&range)
Definition algorithms.hpp:523
constexpr auto replaceCopy(input_range auto &&range, auto outputIterator, const auto &oldValue, const auto &newValue)
Definition algorithms.hpp:617
constexpr auto minmaxElement(forward_range auto &&range)
Definition algorithms.hpp:390
constexpr auto lowerBound(forward_range auto &&sortedRange, const auto &value, auto compare)
Definition algorithms.hpp:426
constexpr auto inplaceMerge(bidirectional_range auto &&sortedRange, auto middleIterator)
Definition algorithms.hpp:497
constexpr auto moveBackward(bidirectional_range auto &&range, auto outputEnd)
Definition algorithms.hpp:673
constexpr auto copyBackward(bidirectional_range auto &&range, auto outputEnd)
Definition algorithms.hpp:665
constexpr auto copyIf(input_range auto &&range, auto outputIterator, auto predicate)
Definition algorithms.hpp:661
constexpr auto equalRange(forward_range auto &&sortedRange, const auto &value, auto compare)
Definition algorithms.hpp:465
constexpr void sortByAscending(random_access_range auto &&range)
Definition algorithms.hpp:514
constexpr LessThan LESS_THAN
Definition algorithms.hpp:44
constexpr Divide DIVIDE
Definition algorithms.hpp:100
constexpr bool startsWith(input_range auto &&range, input_range auto &&sequence)
Definition algorithms.hpp:335
constexpr auto removeCopy(input_range auto &&range, auto outputIterator, const auto &value)
Definition algorithms.hpp:601
constexpr bool noneOf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:230
constexpr void partialSort(random_access_range auto &&range, auto middleIterator)
Definition algorithms.hpp:541
constexpr GreaterThan GREATER_THAN
Definition algorithms.hpp:60
constexpr std::size_t combineHashes(std::size_t hash, convertible_to< std::size_t > auto... otherHashes)
Definition algorithms.hpp:141
constexpr auto containsBy(input_range auto &&range, const auto &value)
Definition algorithms.hpp:305
constexpr bool isSorted(forward_range auto &&range)
Definition algorithms.hpp:398
constexpr auto partialSortCopy(input_range auto &&range, random_access_range auto &&outputRange)
Definition algorithms.hpp:549
constexpr bool containsSubrange(forward_range auto &&range, forward_range auto &&sequence)
Definition algorithms.hpp:315
constexpr auto move(input_range auto &&range, auto outputIterator)
Definition algorithms.hpp:669
constexpr auto rotate(forward_range auto &&range, auto middle)
Definition algorithms.hpp:641
constexpr void sort(random_access_range auto &&range)
Definition algorithms.hpp:505
constexpr auto removeIf(forward_range auto &&range, auto predicate)
Definition algorithms.hpp:597
constexpr GreaterThanOrEqualTo GREATER_THAN_OR_EQUAL_TO
Definition algorithms.hpp:68
constexpr void forEach(input_range auto &&range, auto operation)
Definition algorithms.hpp:181
constexpr auto findIf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:251
constexpr auto accumulate(input_range auto &&range, auto initialValue)
Definition algorithms.hpp:202
constexpr auto search(forward_range auto &&range, forward_range auto &&sequence)
Definition algorithms.hpp:275
constexpr auto stablePartition(bidirectional_range auto &&range, auto predicate)
Definition algorithms.hpp:561
constexpr auto transform(input_range auto &&range, auto outputIterator, auto transformationFunction)
Definition algorithms.hpp:185
constexpr auto maxElement(forward_range auto &&range)
Definition algorithms.hpp:382
constexpr auto upperBound(forward_range auto &&sortedRange, const auto &value)
Definition algorithms.hpp:457
constexpr auto replace(forward_range auto &&range, const auto &oldValue, const auto &newValue)
Definition algorithms.hpp:609
constexpr auto remove(forward_range auto &&range, const auto &value)
Definition algorithms.hpp:593
constexpr auto nthElement(random_access_range auto &&range, auto nthIterator)
Definition algorithms.hpp:569
constexpr bool equal(input_range auto &&rangeA, input_range auto &&rangeB)
Definition algorithms.hpp:358
constexpr auto reduce(input_range auto &&range)
Definition algorithms.hpp:210
constexpr auto partitionPoint(forward_range auto &&partitionedRange, auto compare)
Definition algorithms.hpp:485
constexpr void stableSortByDescending(random_access_range auto &&range)
Definition algorithms.hpp:537
constexpr void generate(forward_range auto &&range, auto generate)
Definition algorithms.hpp:685
constexpr auto replaceIf(forward_range auto &&range, auto predicate, const auto &newValue)
Definition algorithms.hpp:613
constexpr void fill(forward_range auto &&range, const auto &value)
Definition algorithms.hpp:677
constexpr auto partitionCopy(input_range auto &&range, auto trueOutputIterator, auto falseOutputIterator, auto predicate)
Definition algorithms.hpp:565
constexpr auto replaceCopyIf(input_range auto &&range, auto outputIterator, auto predicate, const auto &newValue)
Definition algorithms.hpp:621
constexpr auto merge(input_range auto &&sortedRangeA, input_range auto &&sortedRangeB, auto outputIterator)
Definition algorithms.hpp:489
constexpr bool contains(input_range auto &&range, const auto &value)
Definition algorithms.hpp:299
constexpr void stableSortByAscending(random_access_range auto &&range)
Definition algorithms.hpp:532
auto sample(forward_range auto &&range, auto outputIterator, auto n, auto &&uniformRandomBitGenerator)
Definition algorithms.hpp:629
constexpr auto findEnd(forward_range auto &&range, forward_range auto &&values)
Definition algorithms.hpp:267
constexpr NotEqualTo NOT_EQUAL_TO
Definition algorithms.hpp:36
constexpr std::size_t getRangeHash(input_range auto &&range)
Definition algorithms.hpp:151
constexpr auto countIf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:238
constexpr auto mismatch(input_range auto &&range, input_range auto &&sequence)
Definition algorithms.hpp:283
constexpr void reverse(bidirectional_range auto &&range)
Definition algorithms.hpp:633
constexpr EqualTo EQUAL_TO
Definition algorithms.hpp:28
constexpr Multiply MULTIPLY
Definition algorithms.hpp:92
constexpr auto minElement(forward_range auto &&range)
Definition algorithms.hpp:374
constexpr auto shiftLeft(forward_range auto &&range, auto n)
Definition algorithms.hpp:649
constexpr auto uniqueCopy(input_range auto &&range, auto outputIterator)
Definition algorithms.hpp:585
constexpr auto findFirstOf(input_range auto &&range, forward_range auto &&values)
Definition algorithms.hpp:259
constexpr Modulo MODULO
Definition algorithms.hpp:108
constexpr std::size_t getHash(const T &value, const Ts &... otherValues)
Definition algorithms.hpp:147
constexpr bool includes(input_range auto &&sortedRange, input_range auto &&sortedSequence)
Definition algorithms.hpp:410
constexpr bool isPartitioned(input_range auto &&range, auto compare)
Definition algorithms.hpp:406
constexpr auto copy(input_range auto &&range, auto outputIterator)
Definition algorithms.hpp:657
constexpr auto adjacentFind(forward_range auto &&range)
Definition algorithms.hpp:291
void shuffle(random_access_range auto &&range, auto &&uniformRandomBitGenerator)
Definition algorithms.hpp:625
constexpr void iota(forward_range auto &&range, auto firstValue)
Definition algorithms.hpp:681
constexpr void swapRanges(input_range auto &&rangeA, input_range auto &&rangeB)
Definition algorithms.hpp:169
constexpr void iterSwap(auto itA, auto itB)
Definition algorithms.hpp:164
constexpr bool allOf(input_range auto &&range, auto predicate)
Definition algorithms.hpp:226
constexpr auto rotateCopy(forward_range auto &&range, auto middle, auto outputIterator)
Definition algorithms.hpp:645
constexpr auto findIfNot(input_range auto &&range, auto predicate)
Definition algorithms.hpp:255
constexpr LessThanOrEqualTo LESS_THAN_OR_EQUAL_TO
Definition algorithms.hpp:52
Definition algorithms.hpp:70
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a)+std::forward< B >(b))
Definition algorithms.hpp:72
Definition algorithms.hpp:94
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a)/std::forward< B >(b))
Definition algorithms.hpp:96
Definition algorithms.hpp:22
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a)==std::forward< B >(b))
Definition algorithms.hpp:24
Definition algorithms.hpp:62
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) >=std::forward< B >(b))
Definition algorithms.hpp:64
Definition algorithms.hpp:54
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) > std::forward< B >(b))
Definition algorithms.hpp:56
Definition algorithms.hpp:46
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a)<=std::forward< B >(b))
Definition algorithms.hpp:48
Definition algorithms.hpp:38
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a)< std::forward< B >(b))
Definition algorithms.hpp:40
Definition algorithms.hpp:102
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) % std::forward< B >(b))
Definition algorithms.hpp:104
Definition algorithms.hpp:86
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) *std::forward< B >(b))
Definition algorithms.hpp:88
Definition algorithms.hpp:110
constexpr auto operator()(A &&a) const -> decltype(-std::forward< A >(a))
Definition algorithms.hpp:112
Definition algorithms.hpp:30
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) !=std::forward< B >(b))
Definition algorithms.hpp:32
Definition algorithms.hpp:78
constexpr auto operator()(A &&a, B &&b) const -> decltype(std::forward< A >(a) - std::forward< B >(b))
Definition algorithms.hpp:80