KUMI v4.0.0
Flawless Fluorite
Loading...
Searching...
No Matches

◆ pop_front

pop_front_t kumi::pop_front {}
inlineconstexprnodiscard

Callable object removing the first (if any) element of t.

Callable object removing the last(if any) element of t.

On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.

Header file

#include <kumi/algorithm/push_pop.hpp>

Call Signature

template<product_type T>
constexpr auto pop_front(T && t);
constexpr pop_front_t pop_front
Callable object removing the first (if any) element of t.
Definition push_pop.hpp:166

Parameters

  • t: Base product type

Return value

  • A product type composed of all elements of t except its first. Has no effect on empty product types.

Helper type

template<kumi::concepts::product_type T> struct pop_front
{
using type = decltype(kumi::pop_front(std::declval<T>()));
};
template<kumi::concepts::product_type T> using pop_front_t = typename kumi::result::pop_front<T>::type;

Computes the return type of a call to kumi:pop_front

Examples

Tuple

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
std::cout << kumi::pop_front( kumi::tuple{} ) << "\n";
kumi::tuple t{1,2.,3.4f};
std::cout << t << "\n";
std::cout << kumi::pop_front(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 << kumi::pop_front( kumi::record{} ) << "\n";
kumi::record r{"a"_id = 1,"b"_id = 2.,"c"_id = 3.4f};
std::cout << r << "\n";
std::cout << kumi::pop_front(r) << "\n";
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36

On record types, this function operates on elements as if they were ordered. The considered order is the order of declaration.

Header file

#include <kumi/algorithm/push_pop.hpp>

Call Signature

template<product_type T, typename V>
constexpr auto pop_back(T && t, V && v);

Parameters

  • t: Base product type

Return value

A product type composed of all elements of `t` except its last. Has no effect on empty product types.

Helper type

template<kumi::concepts::product_type T> struct pop_back
{
using type = decltype(kumi::pop_back(std::declval<T>()));
};
template<kumi::concepts::product_type T> using pop_back_t = typename kumi::result::pop_back<T>::type;

Computes the return type of a call to kumi:pop_back

Examples

Tuple

#include <kumi/kumi.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";
}

Record

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
using namespace kumi::literals;
std::cout << kumi::pop_back( kumi::record{} ) << "\n";
kumi::record r{"a"_id = 1,"b"_id = 2.,"c"_id = 3.4f};
std::cout << r << "\n";
std::cout << kumi::pop_back(r) << "\n";
}