75template <
class Itor,
class Operation>
98template<
class Itor,
class Operation>
99[[
nodiscard]]
inline typename Itor::difference_type
102 typename Itor::difference_type n = 0;
125template <
class Itor,
class T>
126[[
nodiscard]]
inline typename Itor::difference_type
127count(
const Itor &
beg,
const Itor & end,
const T & value)
204template<
class Itor,
class UnaryPredicate>
229template<
class Itor,
class T>
253template<
class Itor,
class Size,
class T,
413 while (current != end)
515[[
nodiscard]]
inline std::pair<Itor1, Itor2>
583template <
class Itor1,
class Itor2>
606template <
class Itor1,
class Itor2>
631template <
class Itor1,
class Itor2,
class UnaryFunc>
659template <
class Itor1,
class Itor2,
class Itor3,
class BinaryFunc>
685template <
class Itor1,
class Itor2>
706template <
class Itor,
class T>
707inline void fill(Itor
beg,
const Itor& end,
const T & value)
726template <
class Itor,
class T,
class Size>
745template <
class Itor,
class Func>
765template <
class Itor,
class Size,
class Func>
787template <
class Itor,
class UnaryPredicate,
class T>
814template <
class Itor,
class T>
841template <
class Itor1,
class Itor2,
class UnaryPredicate,
class T>
877template <
class Itor1,
class Itor2,
class T>
904template <
class In_Itor,
class Out_Itor,
class Predicate>
933template<
class Fw_Itor,
class Predicate>
961template<
class Fw_Itor,
class T>
1005template<
class In_Itor,
class Out_Itor>
1031template <
class In_Itor,
class Out_Itor,
class BinaryPredicate>
1093template <
class Itor>
1097 std::swap(*
beg++, *end);
1113template <
class Itor1,
class Itor2>
1137template <
class Itor>
1160template <
class Itor1,
class Itor2>
1189template <
class Itor,
class T>
1214template <
class Itor,
class T,
class BinaryPredicate>
1238template <
class Itor,
class T>
1260template <
class Itor,
class T,
class BinaryPredicate>
1283template<
class Itor,
class T>
1287 return i != end
and not (value < *i);
1306template<
class Itor,
class T,
class BinaryPredicate>
1311 return i != end
and not op(value, *i);
1328template <
class Itor,
class T>
1329[[
nodiscard]]
inline std::pair<Itor, Itor>
1349template <
class Itor,
class T,
class BinaryPredicate>
1350[[
nodiscard]]
inline std::pair<Itor, Itor>
1372template <
class Itor1,
class Itor2>
1409template <
class Itor1,
class Itor2,
class Itor3>
1451template <
class Itor1,
class Itor2,
class Itor3,
class BinaryPredicate>
1492template <
class Itor,
class T>
1495 for ( ;
beg != end; ++
beg)
1517template <
class Itor,
class T,
class BinaryFunc>
1520 for ( ;
beg != end; ++
beg)
1542template <
class Itor1,
class Itor2,
class T>
1571template <
class Itor1,
class Itor2,
class T,
class BinaryFunc1,
class BinaryFunc2>
1595template <
class Itor1,
class Itor2>
1630template <
class Itor1,
class Itor2,
class BinaryFunc>
1666template <
class Itor1,
class Itor2>
1672 typename Itor1::value_type prev = *
sourceBeg;
1679 typename Itor1::value_type curr = *
sourceBeg;
1702template <
class Itor1,
class Itor2,
class BinaryFunc>
1709 typename Itor1::value_type prev = *
sourceBeg;
1716 typename Itor1::value_type curr = *
sourceBeg;
Debug assertion and warning utilities.
General utility functions and helpers.
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_min_function > > min(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
Main namespace for Aleph-w library functions.
Itor lower_bound(Itor beg, Itor end, const T &value)
Find lower bound in a sorted range.
std::pair< Itor1, Itor2 > mismatch(Itor1 beg, const Itor1 &end, Itor2 cmpBeg, BinaryPredicate op=BinaryPredicate())
Find the first mismatching elements in two ranges.
void reverse(Itor beg, Itor end)
Reverse elements in a range.
Itor unique(Itor __first, Itor __last, BinaryPredicate __binary_pred=BinaryPredicate())
Remove consecutive duplicates in place.
Itor2 partial_sum(Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg)
Compute partial sums of a range.
Itor2 copy_backward(const Itor1 &sourceBeg, Itor1 sourceEnd, Itor2 destEnd)
Copy elements backward from one range to another.
Itor1 find_end(Itor1 beg, Itor1 end, Itor2 searchBeg, Itor2 searchEnd, BinaryPredicate op=BinaryPredicate())
Find the last occurrence of a subrange.
void generate(Itor beg, const Itor &end, Func op)
Generate values for a range.
T inner_product(Itor1 beg1, Itor1 end1, Itor2 beg2, T initValue)
Compute inner product of two ranges.
binder2nd< _Operation > bind2nd(const _Operation &__fn, const _Tp &__x)
void replace_if(Itor beg, const Itor &end, UnaryPredicate op, const T &value)
Replace elements satisfying a predicate.
Out_Itor unique_copy(In_Itor __first, In_Itor __last, Out_Itor __result)
Copy unique elements.
Itor2 copy(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg)
Copy elements from one range to another.
bool lexicographical_compare(Itor1 beg1, const Itor1 &end1, Itor2 beg2, const Itor2 &end2, Comp op=Comp())
Lexicographical comparison of two ranges.
void fill(Itor beg, const Itor &end, const T &value)
Fill a range with a value.
Out_Itor remove_copy_if(In_Itor __first, const In_Itor &__last, Out_Itor __result, Predicate __pred)
Copy elements not satisfying a predicate.
std::decay_t< typename HeadC::Item_Type > T
Itor2 adjacent_difference(Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg)
Compute adjacent differences.
Itor adjacent_find(Itor beg, const Itor &end, BinaryPredicate op=BinaryPredicate())
Find first pair of adjacent equal elements.
T accumulate(Itor beg, Itor end, T initValue)
Accumulate values in a range.
Itor find(const Itor &beg, const Itor &end, const T &value)
Find the first element equal to a value.
Itor2 swap_ranges(Itor1 beg1, const Itor1 &end1, Itor2 beg2)
Swap elements between two ranges.
Itor min_element(Itor beg, const Itor &end, CompFunc op=CompFunc())
Find the minimum element in a range.
Itor2 replace_copy_if(Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg, UnaryPredicate op, const T &value)
Copy and replace elements satisfying a predicate.
Itor upper_bound(Itor beg, Itor end, const T &value)
Find upper bound in a sorted range.
Fw_Itor remove(Fw_Itor __first, const Fw_Itor &__last, const T &__value)
Remove elements equal to a value.
Itor search_n(Itor beg, const Itor &end, Size count, const T &value, BinaryPredicate op=BinaryPredicate())
Find n consecutive elements equal to a value.
Itor1 search(Itor1 beg, const Itor1 &end, Itor2 searchBeg, const Itor2 &searchEnd, BinaryPredicate op=BinaryPredicate())
Search for a subrange within a range.
bool equal(Itor1 beg, const Itor1 &end, Itor2 cmpBeg, BinaryPredicate op=BinaryPredicate())
Test if two ranges are equal.
Itor2 transform(Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg, UnaryFunc op)
Transform elements using a unary operation.
Operation for_each(Itor beg, const Itor &end, Operation op)
Apply an operation to each element in a range.
void fill_n(Itor beg, Size num, const T &value)
Fill n elements with a value.
Itor1 find_first_of(const Itor1 &beg, const Itor1 &end, Itor2 searchBeg, const Itor2 &searchEnd, BinaryPredicate op=BinaryPredicate())
Find first element from a set.
Itor2 replace_copy(const Itor1 &sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg, const T &old_value, const T &new_value)
Copy and replace elements equal to a value.
Fw_Itor remove_if(Fw_Itor __first, const Fw_Itor &__last, Predicate __pred)
Remove elements satisfying a predicate.
Itor3 merge(Itor1 source1Beg, Itor1 source1End, Itor2 source2Beg, Itor2 source2End, Itor3 destBeg)
Merge two sorted ranges.
bool binary_search(Itor beg, Itor end, const T &value)
Binary search for a value.
Itor::difference_type count_if(Itor beg, const Itor &end, Operation op)
Count elements satisfying a predicate.
void generate_n(Itor beg, Size num, Func op)
Generate values for n elements.
bool includes(Itor1 beg, Itor1 end, Itor2 searchBeg, Itor2 searchEnd)
Test if one sorted range includes another.
std::pair< Itor, Itor > equal_range(Itor beg, Itor end, const T &value)
Find equal range in a sorted sequence.
Itor2 reverse_copy(Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg)
Copy elements in reverse order.
void next()
Advance all underlying iterators (bounds-checked).
Itor max_element(const Itor &beg, const Itor &end, CompFunc op=CompFunc())
Find the maximum element in a range.
void replace(Itor beg, const Itor &end, const T &old_value, const T &new_value)
Replace elements equal to a value.
Itor find_if(Itor beg, const Itor &end, UnaryPredicate op)
Find the first element satisfying a predicate.
void rotate(Itor beg, Itor pos, Itor end)
Rotate elements in a range.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
T sum(const Container &container, const T &init=T{})
Compute sum of all elements.
Itor2 rotate_copy(const Itor1 &beg, const Itor1 &pos, const Itor1 &end, Itor2 tgt_beg)
Copy and rotate elements.