0.3.0
Loading...
Searching...
No Matches
NAV::CartesianProduct::tuple_algos Namespace Reference

Functions

template<typename Tuple, typename Predicate>
bool any_of (Tuple &&tuple, Predicate pred)
 Any_of algorithm for tuples.
 
template<typename Tuple, typename Predicate>
size_t find_if (Tuple &&tuple, Predicate pred)
 Find_if for tuples.
 
template<class F, class Tuple>
constexpr decltype(auto) for_each (Tuple &&t, F &&f)
 For-each algorithm for tuples.
 
template<class Tuple, class F, std::size_t... I>
for_each_impl (Tuple &&t, F &&f, std::index_sequence< I... >)
 For-each implementation for tuples.
 
template<typename... Ts, typename Function>
auto transform (std::tuple< Ts... > const &inputs, Function function)
 Transform algorithm for tuples.
 
template<class Tuple, class F, std::size_t... Is>
auto transform_impl (Tuple &&t, F &&f, std::index_sequence< Is... >) -> decltype(std::make_tuple(std::forward< F >(f)(std::get< Is >(std::forward< Tuple >(t)))...))
 Transform implementation for tuples.
 

Function Documentation

◆ any_of()

template<typename Tuple, typename Predicate>
bool NAV::CartesianProduct::tuple_algos::any_of ( Tuple && tuple,
Predicate pred )

Any_of algorithm for tuples.

Parameters
[in]tupleThe tuple to search
[in]predPredicate to check for
Returns
True if any of the tuple entries fulfills the predicate

Definition at line 115 of file CartesianProduct.hpp.

◆ find_if()

template<typename Tuple, typename Predicate>
size_t NAV::CartesianProduct::tuple_algos::find_if ( Tuple && tuple,
Predicate pred )

Find_if for tuples.

Parameters
[in]tupleThe tuple to search
[in]predPredicate to use for finding
Returns
Index of the found entry

Definition at line 94 of file CartesianProduct.hpp.

◆ for_each()

template<class F, class Tuple>
decltype(auto) NAV::CartesianProduct::tuple_algos::for_each ( Tuple && t,
F && f )
constexpr

For-each algorithm for tuples.

Parameters
[in]tThe tuple
[in]fFunction to call
Returns
Function return value

Definition at line 50 of file CartesianProduct.hpp.

◆ for_each_impl()

template<class Tuple, class F, std::size_t... I>
F NAV::CartesianProduct::tuple_algos::for_each_impl ( Tuple && t,
F && f,
std::index_sequence< I... >  )

For-each implementation for tuples.

Parameters
[in]tThe tuple
[in]fFunction to call

Definition at line 40 of file CartesianProduct.hpp.

◆ transform()

template<typename... Ts, typename Function>
auto NAV::CartesianProduct::tuple_algos::transform ( std::tuple< Ts... > const & inputs,
Function function )

Transform algorithm for tuples.

Parameters
[in]inputsInput tuple
[in]functionFunction to call
Returns
The transformed tuple

Definition at line 84 of file CartesianProduct.hpp.

◆ transform_impl()

template<class Tuple, class F, std::size_t... Is>
auto NAV::CartesianProduct::tuple_algos::transform_impl ( Tuple && t,
F && f,
std::index_sequence< Is... >  ) -> decltype(std::make_tuple(std::forward<F>(f)(std::get<Is>(std::forward<Tuple>(t)))...))

Transform implementation for tuples.

Parameters
[in]tTuple
[in]fFunction to call
Returns
The transformed tuple

Definition at line 61 of file CartesianProduct.hpp.