Simple-Utility v2.3.1
Loading...
Searching...
No Matches
sl::tuple Namespace Reference

Classes

struct  apply_result
 Trait type determining the result of a std::apply call. More...
 
struct  cartesian_product_result
 Trait type determining the result of a cartesian_product call. More...
 
struct  cat_result
 Trait type determining the result of a std::tuple_cat call. More...
 
struct  envelop_elements_result
 Trait type determining the result of a tuple_envelop_elements call. More...
 
struct  zip_result
 Trait type determining the result of a zip call. More...
 

Typedefs

template<class Tuple >
using envelop_elements_result_t = typename envelop_elements_result< Tuple >::type
 Alias type determining the result of a tuple_envelop_elements call.
 
template<class... Tuples>
using zip_result_t = typename zip_result< Tuples... >::type
 Alias type determining the result of a zip call.
 
template<class... Tuples>
using cartesian_product_result_t = typename cartesian_product_result< Tuples... >::type
 Alias type determining the result of a cartesian_product call.
 
template<class Func , class Tuple >
using apply_result_t = typename apply_result< Func, Tuple >::type
 Alias type determining the result of a std::apply call.
 
template<class... Tuples>
using tuple_cat_result_t = typename cat_result< Tuples... >::type
 Alias type determining the result of a std::tuple_cat call.
 

Functions

template<class Tuple , class Transform >
requires concepts::tuple<std::remove_cvref_t<Tuple>>
constexpr auto transform_elements (Tuple &&tuple, Transform transform)
 Applies the transform on each element of the given source tuple and returns the results as a new tuple.
 
template<class Tuple >
requires concepts::tuple<std::remove_cvref_t<Tuple>>
constexpr envelop_elements_result_t< Tuple > envelop_elements (Tuple &&tuple) noexcept(std::is_nothrow_constructible_v< std::remove_cvref_t< Tuple >, Tuple >)
 Envelops all elements of the given tuple into their own std::tuple and creates a tuple of tuples.
 
template<class First , class Second , class... Others>
requires concepts::tuple<std::remove_cvref_t<First>> && concepts::tuple<std::remove_cvref_t<Second>> && (concepts::tuple<std::remove_cvref_t<Others>> && ...)
constexpr zip_result_t< First, Second, Others... > zip (First &&first, Second &&second, Others &&... others)
 Zips elements of all provided source tuples and creates a tuple of tuples.
 
template<concepts::tuple First, concepts::tuple Second, concepts::tuple... Others>
constexpr cartesian_product_result_t< First, Second, Others... > cartesian_product (const First &first, const Second &second, const Others &... others) noexcept(std::is_nothrow_copy_constructible_v< First > &&std::is_nothrow_copy_constructible_v< Second > &&(std::is_nothrow_copy_constructible_v< Others > &&...))
 Creates the cartesian product of the given tuples.