Simple-Utility v2.3.1
Loading...
Searching...
No Matches
Algorithm.hpp File Reference
#include <algorithm>
#include <functional>
#include <type_traits>
#include "Simple-Utility/tuple/General.hpp"
Include dependency graph for Algorithm.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sl::tuple::envelop_elements_result< Tuple >
 Trait type determining the result of a tuple_envelop_elements call. More...
 
struct  sl::tuple::zip_result< Tuples >
 Trait type determining the result of a zip call. More...
 
struct  sl::tuple::cartesian_product_result< Tuples >
 Trait type determining the result of a cartesian_product call. More...
 

Namespaces

namespace  sl
 
namespace  sl::tuple
 

Typedefs

template<class Tuple >
using sl::tuple::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 sl::tuple::zip_result_t = typename zip_result< Tuples... >::type
 Alias type determining the result of a zip call.
 
template<class... Tuples>
using sl::tuple::cartesian_product_result_t = typename cartesian_product_result< Tuples... >::type
 Alias type determining the result of a cartesian_product call.
 

Functions

template<class Tuple , class Transform >
requires concepts::tuple<std::remove_cvref_t<Tuple>>
constexpr auto sl::tuple::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 > sl::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... > sl::tuple::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... > sl::tuple::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.