Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::zip_detail Namespace Reference

Typedefs

template<class T >
using curr_tuple_t = std::conditional_t< std::is_copy_constructible_v< T >, const std::tuple< T >, std::tuple< T > >
 The tuple where a recursive zip iterator keeps the current item of its first container, which std::tuple_cat() then copies into the tuple that it gives: constant, so that the copy is T(const T &), unless T can only be copied from an item that is not constant (T(T &)), which the copy from a tuple that is not constant takes.
 

Functions

template<class Cmp , class Tuple , size_t... Is>
bool compare_adjacent (Cmp &cmp, const Tuple &t, std::index_sequence< Is... >)
 Compare all adjacent pairs in a tuple using the given comparator.
 

Variables

template<class It , class T >
constexpr bool nothrow_curr_copy
 Whether reading the current item with get_curr_ne() of a constant iterator of type It, and building a T from it, cannot throw: the reading and the copy that the get_curr_ne() of a zip iterator makes of the item of each container.
 
template<class Zip >
constexpr bool nothrow_tail_curr
 Whether calling get_curr_ne() on the constant zip iterator Zip, the tail of another one, and moving the tuple that it gives into a longer one, cannot throw.
 
template<class T >
constexpr bool nothrow_item_copy
 Whether std::tuple_cat() copies the item kept in a curr_tuple_t<T> without throwing.
 

Typedef Documentation

◆ curr_tuple_t

template<class T >
using Aleph::zip_detail::curr_tuple_t = typedef std::conditional_t<std::is_copy_constructible_v<T>, const std::tuple<T>, std::tuple<T> >

The tuple where a recursive zip iterator keeps the current item of its first container, which std::tuple_cat() then copies into the tuple that it gives: constant, so that the copy is T(const T &), unless T can only be copied from an item that is not constant (T(T &)), which the copy from a tuple that is not constant takes.

Definition at line 103 of file ah-zip.H.

Function Documentation

◆ compare_adjacent()

template<class Cmp , class Tuple , size_t... Is>
bool Aleph::zip_detail::compare_adjacent ( Cmp &  cmp,
const Tuple &  t,
std::index_sequence< Is... >   
)

Compare all adjacent pairs in a tuple using the given comparator.

Parameters
cmpBinary comparator.
tTuple to compare.
Returns
true if cmp(t[i], t[i+1]) is true for all adjacent pairs.

Definition at line 1025 of file ah-zip.H.

References Aleph::and, and cmp().

Referenced by Aleph::zip_cmp().

Variable Documentation

◆ nothrow_curr_copy

template<class It , class T >
constexpr bool Aleph::zip_detail::nothrow_curr_copy
inlineconstexpr
Initial value:
=
noexcept(std::declval<const It &>().get_curr_ne()) and
std::is_nothrow_constructible_v<T, decltype(std::declval<const It &>().get_curr_ne())>

Whether reading the current item with get_curr_ne() of a constant iterator of type It, and building a T from it, cannot throw: the reading and the copy that the get_curr_ne() of a zip iterator makes of the item of each container.

Copying an item that allocates (std::string, DynArray), or whose type the user wrote, may throw; and so may the reading of a container that the user wrote: the zipped containers are read through Const_Iterator, whose get_curr_ne() throws what that of the iterator of the container throws.

Definition at line 83 of file ah-zip.H.

◆ nothrow_item_copy

template<class T >
constexpr bool Aleph::zip_detail::nothrow_item_copy
inlineconstexpr
Initial value:
=
std::is_copy_constructible_v<T> ? std::is_nothrow_copy_constructible_v<T>
: std::is_nothrow_constructible_v<T, T &>

Whether std::tuple_cat() copies the item kept in a curr_tuple_t<T> without throwing.

Definition at line 110 of file ah-zip.H.

◆ nothrow_tail_curr

template<class Zip >
constexpr bool Aleph::zip_detail::nothrow_tail_curr
inlineconstexpr
Initial value:
=
noexcept(std::declval<const Zip &>().get_curr_ne()) and
std::is_nothrow_move_constructible_v<decltype(std::declval<const Zip &>().get_curr_ne())>

Whether calling get_curr_ne() on the constant zip iterator Zip, the tail of another one, and moving the tuple that it gives into a longer one, cannot throw.

Definition at line 92 of file ah-zip.H.