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

◆ push_front()

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

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 &&t, T &&v)
Constructs a tuple by adding a value v at the beginning of t.
Definition push_pop.hpp:40

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

Examples:

#include <kumi/kumi.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:37
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
std::cout << kumi::push_front( kumi::record{}, "a"_f = 63.21) << "\n";
kumi::record t{"a"_f = 1,"b"_f = 2.,"c"_f = 3.4f};
std::cout << t << "\n";
std::cout << kumi::push_front(t, "d"_f = 'Z') << "\n";
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition traits.hpp:366