Fixed-size collection of heterogeneous values. More...
#include <kumi/product_types/tuple.hpp>
Fixed-size collection of heterogeneous values.
kumi::tuple provides an aggregate based implementation of a tuple. It provides algorithms and functions designed to facilitate tuple's handling and transformations.
kumi::tuple is also compatible with standard tuple operations and structured bindings.
| Ts | Sequence of types stored inside kumi::tuple. |
Public Member Functions | |
| template<typename... Us> | |
| constexpr tuple & | operator= (tuple< Us... > &&other) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename... Us> | |
| constexpr tuple & | operator= (tuple< Us... > const &other) |
| Replaces the contents of the tuple with the contents of another tuple. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename CharT, typename Traits> | |
| std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, tuple const &t) noexcept |
| Inserts a kumi::tuple in an output stream. | |
Accessors | |
| template<std::size_t I> requires (I < sizeof...(Ts)) | |
| constexpr decltype(auto) | operator[] (index_t< I > i) &noexcept |
| Extracts the Ith element from a kumi::tuple. | |
|
template<std::size_t I> requires (I < sizeof...(Ts)) | |
| constexpr decltype(auto) | operator[] (index_t< I >) &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<std::size_t I> requires (I < sizeof...(Ts)) | |
| constexpr decltype(auto) | operator[] (index_t< I >) const &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<std::size_t I> requires (I < sizeof...(Ts)) | |
| constexpr decltype(auto) | operator[] (index_t< I >) const &noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T> requires (concepts::uniquely_typed<Ts...> && concepts::contains_type<T, Ts...>) | |
| constexpr decltype(auto) | operator[] (as< T > type) &noexcept |
| Extracts the element with type T from a kumi::tuple. | |
|
template<typename T> requires (concepts::uniquely_typed<Ts...> && concepts::contains_type<T, Ts...>) | |
| constexpr decltype(auto) | operator[] (as< T >) &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<typename T> requires (concepts::uniquely_typed<Ts...> && concepts::contains_type<T, Ts...>) | |
| constexpr decltype(auto) | operator[] (as< T >) const &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<typename T> requires (concepts::uniquely_typed<Ts...> && concepts::contains_type<T, Ts...>) | |
| constexpr decltype(auto) | operator[] (as< T >) const &noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<str L> requires (concepts::contains_label<label_t<L>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< L > s) &noexcept |
| Extracts the element of the field labeled L from a kumi::tuple. | |
|
template<str L> requires (concepts::contains_label<label_t<L>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< L >) &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<str L> requires (concepts::contains_label<label_t<L>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< L >) const &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<str L> requires (concepts::contains_label<label_t<L>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< L >) const &noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<concepts::identifier Id> requires (concepts::uniquely_named<Ts...> && concepts::contains_field<Id, Ts...>) | |
| constexpr decltype(auto) | operator[] (Id const &) &noexcept |
| Extracts the element whose identifier matches Id from a kumi::tuple. | |
|
template<concepts::identifier Id> requires (concepts::uniquely_named<Ts...> && concepts::contains_field<Id, Ts...>) | |
| constexpr decltype(auto) | operator[] (Id const &) &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<concepts::identifier Id> requires (concepts::uniquely_named<Ts...> && concepts::contains_field<Id, Ts...>) | |
| constexpr decltype(auto) | operator[] (Id const &) const &&noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
|
template<concepts::identifier Id> requires (concepts::uniquely_named<Ts...> && concepts::contains_field<Id, Ts...>) | |
| constexpr decltype(auto) | operator[] (Id const &) const &noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Conversions | |
| template<typename... Us> requires (sizeof...(Us) == sizeof...(Ts)) && (!std::same_as<tuple<Ts...>, tuple<Us...>>) | |
| explicit (!kumi_implementation_defined) const expr operator tuple< Us... >() const | |
| Enables static casting a tuple<Ts...> to a tuple<Us...>, the conversions is explicit if the casting requires internal explicit conversions. | |
|
template<typename... Us> requires (sizeof...(Us) == sizeof...(Ts)) && (!std::same_as<tuple<Ts...>, tuple<Us...>>) | |
| explicit (!kumi_implementation_defined) const expr operator tuple< Us... >() | |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Properties | |
| static constexpr auto | size () noexcept |
| static constexpr bool | empty () noexcept |
| static constexpr auto | identifiers () noexcept |
| Returns the identifier associated to the elements of a kumi::tuple. | |
| static constexpr auto | labels () noexcept |
| Returns the labels associated to the elements of a kumi::tuple. | |
Comparison operators | |
|
template<typename... Us> requires (concepts::equality_comparable<tuple, tuple<Us...>>) | |
| constexpr auto | operator== (tuple const &self, tuple< Us... > const &other) noexcept |
| Compares a tuple with an other for equality. | |
|
template<typename... Us> requires (concepts::equality_comparable<tuple, tuple<Us...>>) | |
| constexpr auto | operator!= (tuple const &self, tuple< Us... > const &other) noexcept |
| Compares a tuple with an other for inequality. | |
| template<typename... Us> requires (sizeof...(Ts) == sizeof...(Us)) | |
| constexpr auto | operator< (tuple const &lhs, tuple< Us... > const &rhs) noexcept |
| Compares tuples for lexicographical is less relation. | |
|
template<typename... Us> requires requires { rhs < lhs; } | |
| constexpr auto | operator<= (tuple const &lhs, tuple< Us... > const &rhs) noexcept |
| Compares tuples for lexicographical is less or equal relation. | |
|
template<typename... Us> requires requires { rhs < lhs; } | |
| constexpr auto | operator> (tuple const &lhs, tuple< Us... > const &rhs) noexcept |
| Compares tuples for lexicographical is greater relation. | |
|
template<typename... Us> requires requires { lhs < rhs; } | |
| constexpr auto | operator>= (tuple const &lhs, tuple< Us... > const &rhs) noexcept |
| Compares tuples for lexicographical is greater or equal relation. | |
Tuple deduction guides | |
| template<typename... Ts> | |
| KUMI_CUDA | tuple (Ts &&...) -> tuple< std::unwrap_ref_decay_t< Ts >... > |
| kumi::tuple deduction guide | |
Tuple Accessors | |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &t) noexcept |
| Extracts the Ith element from a kumi::tuple. | |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &&arg) noexcept |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &arg) noexcept |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &&arg) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &t) noexcept |
| Extracts the field labeled L from a kumi::tuple if it exists. | |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &&t) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &t) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &&t) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &t) noexcept |
| Extracts the field identified by Id from a kumi::tuple if it exists. | |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &&t) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &t) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &&t) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &t) noexcept |
| Extracts the field which type is T from a kumi::tuple if it exist. | |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > &&t) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &t) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (tuple< Ts... > const &&t) noexcept |