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

◆ pop_back()

template<product_type Tuple>
constexpr auto kumi::pop_back ( Tuple const &  t)
constexpr

Remove the last (if any) element of a kumi::product_type.

Parameters
tBase tuple
Returns
A tuple composed of all elements of t except its last. Has no effect on empty t.

Helper type

namespace kumi::result
{
template<product_type Tuple> struct pop_back;
template<product_type Tuple>
using pop_back_t = typename pop_back<Tuple>::type;
}
constexpr auto pop_back(Tuple const &t)
Remove the last (if any) element of a kumi::product_type.
Definition: push_pop.hpp:135

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

Example

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