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

◆ push_back()

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

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

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

Helper type

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

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

Example

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