82template <
class It,
class T>
84 noexcept(std::declval<const It &>().get_curr_ne())
and
85 std::is_nothrow_constructible_v<
T,
decltype(std::declval<const It &>().get_curr_ne())>;
93 noexcept(std::declval<const Zip &>().get_curr_ne())
and
94 std::is_nothrow_move_constructible_v<
decltype(std::declval<const Zip &>().get_curr_ne())>;
104 std::conditional_t<std::is_copy_constructible_v<T>,
const std::tuple<T>, std::tuple<T>>;
111 std::is_copy_constructible_v<T> ? std::is_nothrow_copy_constructible_v<T>
112 : std::is_nothrow_constructible_v<T, T &>;
146template <
class HeadC,
class... TailC>
152 using T = std::decay_t<typename HeadC::Item_Type>;
157 =
decltype(std::tuple_cat(std::declval<std::tuple<T>>(),
194 std::tuple<T> curr(it.get_curr());
218 and zip_detail::nothrow_item_copy<
T>
274 using T = std::decay_t<typename C::Item_Type>;
296 return std::tuple<T>(Base::get_curr());
312 return std::tuple<T>(Base::get_curr_ne());
335template <
class... Cs>
348template <
class... Cs>
352 for (
size_t i = 0; i < pos; ++i)
358template <
class... Cs>
365template <
class... Cs>
377template <
class... Cs>
381 for (; it.has_curr(); it.next_ne())
384 return it.completed();
414template <
class Op,
class... Cs>
417 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
418 if (not op(it.get_curr()))
431template <
class Op,
class... Cs>
435 for (; it.has_curr(); it.next_ne())
436 if (not op(it.get_curr()))
438 return it.completed();
470template <
class Op,
class... Cs>
473 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
484template <
class Op,
class... Cs>
488 for (; it.has_curr(); it.next_ne())
491 ah_length_error_if(not it.completed()) <<
"zip_for_each_eq() containers sizes mismatch";
504template <
class Op,
class... Cs>
505[[nodiscard]]
inline bool zip_all(Op &&op,
const Cs &...cs)
508 for (; it.has_curr(); it.next_ne())
509 if (not op(it.get_curr()))
512 return it.completed();
525template <
class Op,
class... Cs>
528 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
529 if (not op(it.get_curr()))
539template <
class Op,
class... Cs>
540[[nodiscard]]
inline bool zip_forall(Op &&op,
const Cs &...cs)
542 return zip_all(std::forward<Op>(op), cs...);
549template <
class Op,
class... Cs>
564template <
class Op,
class... Cs>
565[[nodiscard]]
inline bool zip_exists(Op &&op,
const Cs &...cs)
567 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
568 if (op(it.get_curr()))
578template <
class Op,
class... Cs>
579[[nodiscard]]
inline bool zip_any(Op &&op,
const Cs &...cs)
581 return zip_exists(std::forward<Op>(op), cs...);
593template <
class Op,
class... Cs>
594[[nodiscard]]
inline bool zip_none(Op &&op,
const Cs &...cs)
596 return not
zip_exists(std::forward<Op>(op), cs...);
606template <
class Op,
class... Cs>
607[[nodiscard]]
inline size_t zip_count(Op &&op,
const Cs &...cs)
610 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
611 if (op(it.get_curr()))
622template <
class... Cs>
626 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
639template <
class Op,
class... Cs>
645 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
646 if (
auto t = it.get_curr(); op(t))
647 return std::make_pair(t,
true);
649 return std::make_pair(ZipType{},
false);
660template <
class Op,
class... Cs>
669 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
670 if (
auto t = it.get_curr(); op(t))
676 return std::make_pair(result, found);
687template <
class... Cs>
694 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne(), ++i)
696 return std::make_pair(it.get_curr(),
true);
698 return std::make_pair(ZipType{},
false);
708template <
class... Cs>
745template <
typename T,
class Op,
class... Cs>
750 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
751 ret.
append(op(it.get_curr()));
764template <
typename T,
class Prop,
class Op,
class... Cs>
769 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
770 if (
auto t = it.get_curr(); prop(t))
804template <
typename T,
class Op,
class... Cs>
809 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
810 acu = op(acu, it.get_curr());
824template <
typename T,
class Op,
class... Cs>
830 for (; it.has_curr(); it.next_ne())
831 acu = op(acu, it.get_curr());
847template <
typename T,
class Op,
class... Cs>
853 for (; it.has_curr(); it.next_ne())
854 ret.
append(op(it.get_curr()));
871template <
typename T,
class Prop,
class Op,
class... Cs>
877 for (; it.has_curr(); it.next_ne())
878 if (
auto t = it.get_curr(); prop(t))
881 ah_length_error_if(not it.completed()) <<
"zip_maps_if_eq() containers sizes mismatch";
896template <
class Op,
class... Cs>
901 using ResultType = std::decay_t<decltype(op(std::declval<ZipType>()))>;
904 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
905 ret.
append(op(it.get_curr()));
917template <
class Op,
class... Cs>
922 using ResultType = std::decay_t<decltype(op(std::declval<ZipType>()))>;
926 for (; it.has_curr(); it.next_ne())
927 ret.
append(op(it.get_curr()));
957template <
class Op,
class... Cs>
961 using ZipType =
decltype(
zip_it(cs...).get_curr());
964 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
965 if (
auto t = it.get_curr(); op(t))
998template <
class Op,
class... Cs>
1002 using ZipType =
decltype(
zip_it(cs...).get_curr());
1006 for (; it.has_curr(); it.next_ne())
1007 if (
auto t = it.get_curr(); op(t))
1010 ah_length_error_if(not it.completed()) <<
"zip_filter_eq() containers sizes mismatch";
1018namespace zip_detail {
1024template <
class Cmp,
class Tuple,
size_t... Is>
1028 return (...
and cmp(std::get<Is>(t), std::get<Is + 1>(t)));
1052template <
class Cmp,
class... Cs>
1056 constexpr size_t N =
sizeof...(Cs);
1057 static_assert(
N >= 2,
"zip_cmp requires at least 2 containers");
1059 for (
auto it =
get_zip_it(cs...); it.has_curr(); it.next_ne())
1060 if (
auto t = it.get_curr();
1075template <
class Op,
class... Cs>
1080 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne(), ++i)
1081 if (
auto t = it.get_curr(); op(t))
1122template <
class Op,
class... Cs>
1126 using ZipType =
decltype(
zip_it(cs...).get_curr());
1129 size_t n1 = 0, n2 = 0;
1130 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
1131 if (
auto t = it.get_curr(); op(t))
1142 return std::make_tuple(ret1, n1, ret2, n2);
1173template <
class... Cs>
1174[[nodiscard]]
inline auto t_zip(
const Cs &...cs)
1177 using T =
decltype(it.get_curr());
1179 for (; it.has_curr(); it.next_ne())
1180 ret.
append(it.get_curr());
1192template <
class... Cs>
1196 using T =
decltype(it.get_curr());
1198 for (; it.has_curr(); it.next_ne())
1199 ret.
append(it.get_curr());
1233template <
class HeadC,
class... TailC>
1239 using T = std::decay_t<typename HeadC::Item_Type>;
1251 [[nodiscard]]
bool has_curr() const noexcept
1257 [[nodiscard]]
bool completed() const noexcept
1268 std::tuple<T> curr(it.get_curr());
1296 and zip_detail::nothrow_item_copy<
T>
1300 zip_detail::curr_tuple_t<T> curr(it.get_curr_ne());
1350 using T = std::decay_t<typename C::Item_Type>;
1361 return std::tuple<T, size_t>(Base::get_curr(), i);
1377 return std::tuple<T, size_t>(Base::get_curr_ne(), i);
1393template <
class... Cs>
1407template <
class C,
class... Cs>
1413 for (
size_t i = 0; i < pos; ++i)
1420template <
class... Cs>
1427template <
class... Cs>
1441template <
class... Cs>
1445 using T =
decltype(it.get_curr());
1447 for (; it.has_curr(); it.next_ne())
1448 ret.
append(it.get_curr());
1460template <
class... Cs>
1464 using T =
decltype(it.get_curr());
1466 for (; it.has_curr(); it.next_ne())
1467 ret.
append(it.get_curr());
1474template <
typename... Ts,
size_t... is>
1477 std::tuple<DynList<Ts>...> ret;
1478 for (
auto it =
l.
get_it(); it.has_curr(); it.next_ne())
1479 std::initializer_list<int>{(std::get<is>(ret).append(std::get<is>(it.get_curr())), 0)...};
1490template <
class... Ts>
1493 return t_unzip_impl(tuples, std::index_sequence_for<Ts...>{});
1513template <
class C,
typename... Lists>
1517 using T =
typename C::Item_Type;
1519 for (
auto it =
get_zip_it(c, lists...); it.has_curr(); it.next_ne())
1520 ret.
append(it.get_curr_list());
1532template <
class C,
typename... Lists>
1536 using T =
typename C::Item_Type;
1539 for (; it.has_curr(); it.next_ne())
1540 ret.
append(it.get_curr_list());
1550namespace std_zip_detail {
1555template <
typename... Its>
1558 return (...
and (its.first != its.second));
1564template <
typename... Its>
1574template <
typename... Its>
1577 return std::make_tuple(*its.first...);
1585template <
typename C1,
typename C2>
1589 using T =
typename C1::value_type;
1590 using U =
typename C2::value_type;
1591 std::vector<std::pair<T, U>> result;
1592 auto it1 = c1.begin();
1593 auto it2 = c2.begin();
1594 for (; it1 != c1.end()
and it2 != c2.end(); ++it1, ++it2)
1595 result.emplace_back(*it1, *it2);
1613template <
typename... Cs>
1617 static_assert(
sizeof...(Cs) >= 2,
"tzip_std requires at least 2 containers");
1619 using TupleType = std::tuple<
typename Cs::value_type...>;
1620 std::vector<TupleType> ret;
1623 auto iters = std::make_tuple(std::make_pair(cs.begin(), cs.end())...);
1626 auto check_and_push = [&ret](
auto &...its)
1635 std::apply(check_and_push, iters);
1648template <
typename... Cs>
1665template <
class Op,
class... Cs>
1669 using ZipType =
decltype(
zip_it(cs...).get_curr());
1670 using ResultType = std::decay_t<decltype(op(std::declval<ZipType>()))>;
1672 std::vector<ResultType> ret;
1673 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
1674 ret.push_back(op(it.get_curr()));
1687template <
class Op,
class... Cs>
1691 using ZipType =
decltype(
zip_it(cs...).get_curr());
1692 using ResultType = std::decay_t<decltype(op(std::declval<ZipType>()))>;
1694 std::vector<ResultType> ret;
1696 for (; it.has_curr(); it.next_ne())
1697 ret.push_back(op(it.get_curr()));
1699 ah_length_error_if(not it.completed()) <<
"zip_transform_eq() containers sizes mismatch";
1711template <
class Op,
class... Cs>
1715 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne(), ++idx)
1716 op(idx, it.get_curr());
1726template <
class Op,
class... Cs>
1731 for (; it.has_curr(); it.next_ne(), ++idx)
1732 op(idx, it.get_curr());
1734 ah_length_error_if(not it.completed()) <<
"zip_for_each_indexed_eq() containers sizes mismatch";
1744template <
class... Cs>
1748 using ZipType =
decltype(
zip_it(cs...).get_curr());
1752 ret.
append(it.get_curr());
1763template <
class... Cs>
1767 using ZipType =
decltype(
zip_it(cs...).get_curr());
1772 for (
size_t i = 0; i < n
and it.has_curr(); ++i)
1776 for (; it.has_curr(); it.next_ne())
1777 ret.
append(it.get_curr());
1788template <
class Pred,
class... Cs>
1792 using ZipType =
decltype(
zip_it(cs...).get_curr());
1794 for (
auto it =
zip_it(cs...); it.has_curr(); it.next_ne())
1796 auto t = it.get_curr();
1811template <
class Pred,
class... Cs>
1815 using ZipType =
decltype(
zip_it(cs...).get_curr());
1820 for (; it.has_curr()
and pred(it.get_curr()); it.next_ne())
1824 for (; it.has_curr(); it.next_ne())
1825 ret.
append(it.get_curr());
1836namespace zip_index_detail {
1841template <
class Op,
class Tuple,
size_t... Is>
1844 (op(std::get<Is>(std::forward<Tuple>(t))), ...);
1852template <
class Op,
class Tuple,
size_t... Is>
1855 return std::make_tuple(op(std::get<Is>(std::forward<Tuple>(t)))...);
1863template <
class Pred,
class Tuple,
size_t... Is>
1866 return (...
and pred(std::get<Is>(t)));
1874template <
class Pred,
class Tuple,
size_t... Is>
1877 return (... or
pred(std::get<Is>(t)));
1910template <
class Op,
class Tuple>
1913 constexpr auto N = std::tuple_size_v<std::decay_t<Tuple>>;
1915 std::forward<Tuple>(t),
1916 std::make_index_sequence<N>{});
1949template <
class Op,
class Tuple>
1953 constexpr auto N = std::tuple_size_v<std::decay_t<Tuple>>;
1955 std::forward<Tuple>(t),
1956 std::make_index_sequence<N>{});
1980template <
class Pred,
class Tuple>
1984 constexpr auto N = std::tuple_size_v<std::decay_t<Tuple>>;
1987 std::make_index_sequence<N>{});
2010template <
class Pred,
class Tuple>
2014 constexpr auto N = std::tuple_size_v<std::decay_t<Tuple>>;
2017 std::make_index_sequence<N>{});
2040template <
class Pred,
class Tuple>
#define ah_length_error_if(C)
Throws std::length_error if condition holds.
STL-compatible iterator adapters for Aleph containers.
Functional programming utilities for Aleph-w containers.
Read-only view of an Aleph iterator: the iterator of a constant container.
Doubly-linked list (defined in tpl_dynList.H).
T & append(const T &item)
bool completed() const noexcept
Return true if the underlying iterator has reached the end.
std::tuple< T, size_t > get_curr() const
Return the current tuple (value, index) (bounds-checked).
void next_ne() noexcept(noexcept(std::declval< Base & >().next_ne()))
Advance the iterator and increment the associated index (unchecked variant).
EnumZipIterator(const C &c)
Construct an enumerating iterator over a single container.
void next()
Advance the iterator and increment the associated index (bounds-checked).
std::decay_t< typename C::Item_Type > T
std::tuple< T, size_t > get_curr_ne() const noexcept(zip_detail::nothrow_curr_copy< Base, T >)
Return the current tuple (value, index) (unchecked variant).
Number Theoretic Transform over Z / MOD Z.
std::tuple< T > get_curr_ne() const noexcept(zip_detail::nothrow_curr_copy< Base, T >)
Return the current tuple (unchecked variant).
std::tuple< T > Tuple_Type
The tuple type returned by get_curr() and get_curr_ne()
std::decay_t< typename C::Item_Type > T
bool completed() const noexcept
Return true if the underlying iterator has reached the end.
DynList< T > get_curr_list() const
std::tuple< T > get_curr() const
Return the current tuple (bounds-checked).
ZipIterator(const C &c)
Construct a zip iterator over a single container.
T Item_Type
Type of elements from the container.
Iterator that traverses multiple containers with enumeration index.
auto get_it()
Return a properly initialized iterator positioned at the first item on the container.
Iterator that traverses multiple Aleph containers in lockstep.
int cmp(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
Singly linked list implementations with head-tail access.
Freq_Node * pred
Predecessor node in level-order traversal.
bool all_valid(const Its &...its)
Check if all iterators are valid (not at end).
void advance_all(Its &...its)
Advance all iterators.
auto deref_all(const Its &...its)
Dereference all iterators and make a tuple.
bool compare_adjacent(Cmp &cmp, const Tuple &t, std::index_sequence< Is... >)
Compare all adjacent pairs in a tuple using the given comparator.
constexpr bool nothrow_tail_curr
Whether calling get_curr_ne() on the constant zip iterator Zip, the tail of another one,...
constexpr bool nothrow_curr_copy
Whether reading the current item with get_curr_ne() of a constant iterator of type It,...
constexpr bool nothrow_item_copy
Whether std::tuple_cat() copies the item kept in a curr_tuple_t<T> without throwing.
std::conditional_t< std::is_copy_constructible_v< T >, const std::tuple< T >, std::tuple< T > > curr_tuple_t
The tuple where a recursive zip iterator keeps the current item of its first container,...
bool any_of_tuple_impl(Pred &&pred, const Tuple &t, std::index_sequence< Is... >)
Check if any element satisfies a predicate.
auto transform_tuple_impl(Op &&op, Tuple &&t, std::index_sequence< Is... >)
Transform each element in a tuple.
void for_each_in_tuple_impl(Op &&op, Tuple &&t, std::index_sequence< Is... >)
Apply a function to each element in a tuple.
bool all_of_tuple_impl(Pred &&pred, const Tuple &t, std::index_sequence< Is... >)
Check if all elements satisfy a predicate.
Main namespace for Aleph-w library functions.
ZipIterator< Cs... > zip_it(const Cs &...cs)
Alias for get_zip_it.
void zip_for_each_eq(Op &&op, const Cs &...cs)
Apply op to every zipped tuple; throw if containers differ in length.
EnumZipIterator< Cs... > get_enum_zip_it(const Cs &...cs)
Create an EnumZipIterator over the given containers.
bool zip_traverse_eq(Op &&op, const Cs &...cs)
Traverse zipped containers while op returns true; verify equal lengths.
void zip_for_each_indexed_eq(Op &&op, const Cs &...cs)
Apply op to each zipped tuple with index; throw if lengths differ.
auto zip_drop_while(Pred &&pred, const Cs &...cs)
Skip tuples while predicate pred returns true, then return the rest.
auto t_enum_zip_eq(const Cs &...cs)
Materialize enumerated zipped tuples; throw if containers differ in length.
DynList< T > zip_maps_if_eq(Prop prop, Op op, const Cs &...cs)
Map op over zipped tuples that satisfy prop; throw if lengths differ.
void zip_for_each(Op &&op, const Cs &...cs)
Apply op to every zipped tuple.
T Item_Type
Type of elements from the first container.
bool completed() const noexcept
Return true if all underlying iterators are finished.
EnumZipIterator< Cs... > enum_zip_it_pos(size_t pos, const Cs &...cs)
Alias for get_enum_zip_it_pos.
ZipIterator< Cs... > zip_it_pos(size_t pos, const Cs &...cs)
Alias for get_zip_it_pos.
bool zip_forall_short(Op &&op, const Cs &...cs)
Alias for zip_all_short.
auto get_curr_ne() const noexcept(zip_detail::nothrow_curr_copy< Aleph::const_iterator_t< HeadC >, T > and zip_detail::nothrow_item_copy< T > and zip_detail::nothrow_tail_curr< ZipIterator< TailC... > >)
Return the current tuple (unchecked variant).
auto std_zip(const C1 &c1, const C2 &c2)
Build a vector of pairs from two STL containers.
bool all_of_tuple(Pred &&pred, const Tuple &t)
Return true if all tuple elements satisfy pred.
auto transform_tuple(Op &&op, Tuple &&t)
Transform each element of a tuple, returning a new tuple.
auto zip_transform_eq(Op &&op, const Cs &...cs)
Transform zipped tuples; throw if containers differ in length.
static auto t_unzip_impl(const DynList< std::tuple< Ts... > > &l, std::index_sequence< is... >)
ZipIterator< Cs... > get_zip_it_pos(size_t pos, const Cs &...cs)
Create a ZipIterator positioned at index pos.
bool equal_length(const Cs &...cs)
Return true if all containers have the same length.
T zip_foldl(const T &init, Op op, const Cs &...cs)
Left fold (reduce) over zipped tuples.
bool zip_all_short(Op &&op, const Cs &...cs)
Return true if op returns true for all tuples (without length check).
void for_each_in_tuple(Op &&op, Tuple &&t)
Apply op to each element of a tuple.
auto std_zip_n(const Cs &...cs)
Build a vector of tuples from 2 or more STL containers (variadic).
ZipIterator< Cs... > get_zip_it(const Cs &...cs)
Create a ZipIterator over the given containers.
size_t zip_length(const Cs &...cs)
Count all tuples (minimum length of containers).
auto zip_filter(Op op, const Cs &...cs)
Filter zipped tuples by predicate op.
T zip_foldl_eq(const T &init, Op op, const Cs &...cs)
Left fold over zipped tuples; throw if containers differ in length.
auto t_zip(const Cs &...cs)
Materialize zipped tuples into a DynList.
decltype(std::tuple_cat(std::declval< std::tuple< T > >(), std::declval< typename ZipIterator< TailC... >::Tuple_Type >())) Tuple_Type
The tuple type returned by get_curr() and get_curr_ne()
bool zip_any(Op &&op, const Cs &...cs)
Alias for zip_exists.
Const_Iterator< typename C::Iterator > const_iterator_t
The read-only iterator of the container C.
std::decay_t< typename HeadC::Item_Type > T
auto zip_lists(const C &c, const Lists &...lists)
Take several container of same type and some length and builds a list of lists.
bool zip_forall(Op &&op, const Cs &...cs)
Alias for zip_all.
bool any_of_tuple(Pred &&pred, const Tuple &t)
Return true if any tuple element satisfies pred.
size_t zip_count(Op &&op, const Cs &...cs)
Count tuples that satisfy predicate op.
bool zip_traverse(Op &&op, const Cs &...cs)
Traverse zipped containers while op returns true.
auto get_curr() const
Return the current tuple (bounds-checked).
auto zip_find_first(Op &&op, const Cs &...cs)
Return the first tuple that satisfies predicate op.
and
Check uniqueness with explicit hash + equality functors.
bool zip_all(Op &&op, const Cs &...cs)
Return true if op returns true for all tuples and containers have equal length.
auto t_zip_eq(const Cs &...cs)
Materialize zipped tuples; throw if containers differ in length.
bool none_of_tuple(Pred &&pred, const Tuple &t)
Return true if no tuple element satisfies pred.
bool zip_none(Op &&op, const Cs &...cs)
Return true if op returns false for all tuples.
bool has_curr() const noexcept
Return true if all underlying iterators are positioned on a valid item.
auto tzip_std(const Cs &...cs)
Build a vector of tuples from 2 or more STL containers (variadic).
auto t_enum_zip(const Cs &...cs)
Materialize enumerated zipped tuples into a DynList.
auto zip_first(const Cs &...cs)
Return the first tuple from zipped containers.
EnumZipIterator< Cs... > enum_zip_it(const Cs &...cs)
Alias for get_enum_zip_it.
auto zip_find_last(Op &&op, const Cs &...cs)
Return the last tuple that satisfies predicate op.
auto t_unzip(const DynList< std::tuple< Ts... > > &tuples)
Unzip a list of tuples into a tuple of lists.
auto zip_map(Op &&op, const Cs &...cs)
Map op over zipped tuples with auto-deduced return type.
auto zip_partition(Op op, const Cs &...cs)
Partition zipped tuples by predicate op.
size_t zip_find_index(Op op, const Cs &...cs)
Find the first index where op returns true.
auto zip_take_while(Pred &&pred, const Cs &...cs)
Take tuples while predicate pred returns true.
void zip_for_each_indexed(Op &&op, const Cs &...cs)
Apply op to each zipped tuple along with its index.
bool zip_exists(Op &&op, const Cs &...cs)
Return true if op returns true for at least one tuple.
EnumZipIterator< C, Cs... > get_enum_zip_it_pos(size_t pos, const C &c, const Cs &...cs)
Create an EnumZipIterator positioned at index pos.
auto zip_drop(const size_t n, const Cs &...cs)
Skip n tuples and return the rest.
DynList< T > get_curr_list() const
Returns current elements as a DynList (requires homogeneous Item_Type)
DynList< T > zip_maps_eq(Op op, const Cs &...cs)
Map op over zipped tuples; throw if containers differ in length.
DynList< T > zip_maps(Op op, const Cs &...cs)
Map op over zipped tuples, returning a list of results.
auto zip_filter_eq(Op op, const Cs &...cs)
Filter zipped tuples by predicate op; throw if containers differ in length.
void next()
Advance all underlying iterators (bounds-checked).
auto zip_nth(size_t n, const Cs &...cs)
Return the n-th tuple from zipped containers.
auto zip_lists_eq(const C &c, const Lists &...lists)
Like zip_lists but throws if containers differ in length.
bool zip_cmp(Cmp cmp, const Cs &...cs)
Return true if cmp(t) is true for each built tuple t.
auto zip_map_eq(Op &&op, const Cs &...cs)
Map op over zipped tuples with auto-deduced return type; throw if lengths differ.
auto zip_transform(Op &&op, const Cs &...cs)
Transform zipped tuples using op and return results in a vector.
DynList< T > zip_maps_if(Prop prop, Op op, const Cs &...cs)
Map op over zipped tuples that satisfy prop.
static std::atomic< bool > init
auto zip_take(size_t n, const Cs &...cs)
Take at most n tuples from the zipped containers.
void next_ne() noexcept(noexcept(std::declval< Aleph::const_iterator_t< HeadC > & >().next_ne()) and noexcept(std::declval< ZipIterator< TailC... > & >().next_ne()))
Advance all underlying iterators (unchecked variant).
@ Tuple
Tuple type such as (Int, Bool).
Itor::difference_type count(const Itor &beg, const Itor &end, const T &value)
Count elements equal to a value.
Dynamic ordered set implemented with a Skip List.