Constructs a product type by adding a value v at the beginning of t.
- Parameters
-
| t | Base product type |
| v | Value to insert in front of t |
- Returns
- A product type composed of v followed by all elements of t in order.
On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.
Helper type
namespace kumi::result
{
template<product_type T,
typename V>
struct push_front;
template<product_type T, typename V>
}
constexpr auto push_front(T &&t, V &&v)
Constructs a product type by adding a value v at the beginning of t.
Definition push_pop.hpp:44
Computes the return type of a call to kumi::push_front
Examples:
Tuple:
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << t << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
Record:
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
std::cout << t << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36