|
cxxomfort
rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
Classes | |
| struct | tuple2function_t< Ret, Tuple > |
| Convert from tuple type to function signature.Given a tuple of the form T<T1,T2,...>, obtain a function signature Ret(T1,T2,...) More... | |
| struct | function2tuple_t< FnSig > |
| Convert from function signature type to tuple type.Given a function signature R(T1,T2,...), obtain a tuple of the form T<T1,T2,...> More... | |
Namespaces | |
| cxxomfort | |
Namespace of the cxxomfort library. | |
| cxxomfort::library | |
| Supplements to backports and other utilities. | |
Functions | |
| template<typename T , typename... TArgs> | |
| std::tuple< T, Targs... > | tuple_unshift (T const &t0, std::tuple< TArgs... > const &tu) |
| Returns a tuple with an extra element at the beginning. More... | |
| template<typename T , typename... TArgs> | |
| std::tuple< Targs..., T > | tuple_push (T const &t0, std::tuple< TArgs... > const &tu) |
| Returns a tuple with an extra element at the end. More... | |
| template<typename... TArgs, typename First > | |
| std::tuple< TArgs... > | tuple_shift (std::tuple< TFirst, TArgs... > const &tu) |
| Removes the first type from a tuple. More... | |
| template<typename... TArgs, typename TLast > | |
| std::tuple< TArgs... > | tuple_pop (std::tuple< TArgs..., TLast > const &tu) |
| Removes the last type from a tuple. More... | |
This file provides supplementary features for the tuple-related utilities present in <tuple>.
cxxo-sup-tuple
Interfaces brought from impl: is_tuple , tuple_count_type , tuple_index
All interfaces are defined in the namespace cxxomfort::algorithm::.
| std::tuple<T,Targs...> cxxomfort::library::tuple::tuple_unshift | ( | T const & | t0, |
| std::tuple< TArgs... > const & | tu | ||
| ) |
Returns a tuple with an extra element at the beginning.
| v | An element to be added to a tuple. |
| tu | A std::tuple of N elements. |
std::tuple of N+1 elements { v, tu_0, ... } . | Whatever | make_tuple throws. |
Given a tuple tu and a value v , tuple_unshift creates a new tuple the element v and then the elements of tu .
| std::tuple<Targs...,T> cxxomfort::library::tuple::tuple_push | ( | T const & | t0, |
| std::tuple< TArgs... > const & | tu | ||
| ) |
Returns a tuple with an extra element at the end.
| v | An element to be added to a tuple. |
| tu | A std::tuple of N elements. |
std::tuple of N+1 elements { tu_0, ... , v }. | Whatever | make_tuple throws. |
Given a tuple tu and a value v , tuple_push creates a new tuple with the elements of tu and then the element v .
| std::tuple<TArgs...> cxxomfort::library::tuple::tuple_shift | ( | std::tuple< TFirst, TArgs... > const & | tu | ) |
Removes the first type from a tuple.
| tu | A std::tuple of N+1 elements. |
| Whatever | make_tuple throws. |
Given a tuple tu , tuple_shift creates a new tuple with copies of all but the first element from the original tuple.
If tu is a tuple with only one element, tuple_shift errors at compile-time from trying to build an empty tuple.
In C++03, tuple_shift works with tuples of up to six (6) (seis) types.
| std::tuple<TArgs...> cxxomfort::library::tuple::tuple_pop | ( | std::tuple< TArgs..., TLast > const & | tu | ) |
Removes the last type from a tuple.
| tu | A std::tuple of N+1 elements. |
| Whatever | make_tuple throws. |
Given a tuple tu , tuple_pop creates a new tuple with copies of all but the last element from the original tuple.
If tu is a tuple with only one element, tuple_pop returns an empty tuple.
In C++03, tuple_pop works with tuples of up to six (6) (seis) types.
1.8.13