kumi v3.1.0
Exquisite Epidote
 
Loading...
Searching...
No Matches

◆ push_front()

template<product_type Tuple, typename T >
constexpr auto kumi::push_front ( Tuple const &  t,
T &&  v 
)
constexpr

Constructs a tuple by adding a value v at the beginning of t.

Parameters
tBase tuple
vValue to insert in front of t
Returns
A tuple composed of v followed by all elements of t in order.

Helper type

namespace kumi::result
{
template<product_type Tuple, typename T> struct push_front;
template<product_type Tuple, typename T>
using push_front_t = typename push_front<Tuples...>::type;
}
constexpr auto push_front(Tuple const &t, T &&v)
Constructs a tuple by adding a value v at the beginning of t.
Definition: push_pop.hpp:38

Computes the return type of a call to kumi::push_front

Example

#include <kumi/tuple.hpp>
#include <iostream>
int main()
{
std::cout << kumi::push_front( kumi::tuple{}, 63.21) << "\n";
kumi::tuple t{1,2.,3.4f};
std::cout << t << "\n";
std::cout << kumi::push_front(t, 'Z') << "\n";
}
Fixed-size collection of heterogeneous values.
Definition: tuple.hpp:35