Fixed-size collection of heterogeneous tagged fields, tags are unique. More...
#include <kumi/product_types/record.hpp>
Fixed-size collection of heterogeneous tagged fields, tags are unique.
kumi::record provides an aggregate based implementation of a record. It provides algorithms and functions designed to facilitate record's handling and transformations.
kumi::record is also compatible with standard tuple operations and structured bindings to some extent.
| Ts | Sequence of fields stored inside kumi::record. |
Public Member Functions | |
|
template<typename... Us> requires (concepts::equivalent<record, record<Us...>>) | |
| constexpr record & | operator= (record< 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> requires (concepts::equivalent<record, record<Us...>>) | |
| constexpr record & | operator= (record< Us... > const &other) |
| Replaces the content of the record with the content of another record. | |
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, record const &t) noexcept |
| Inserts a kumi::record 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 field from a kumi::record. | |
|
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<kumi_implementation_defined...> && concepts::contains_type<T, kumi_implementation_defined...>) | |
| constexpr decltype(auto) | operator[] (as< T > type) &noexcept |
| Extracts the element with type T from a kumi::record. | |
|
template<typename T> requires (concepts::uniquely_typed<kumi_implementation_defined...> && concepts::contains_type<T, kumi_implementation_defined...>) | |
| 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<kumi_implementation_defined...> && concepts::contains_type<T, kumi_implementation_defined...>) | |
| 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<kumi_implementation_defined...> && concepts::contains_type<T, kumi_implementation_defined...>) | |
| 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 Name> requires (concepts::contains_label<label_t<Name>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< Name > l) &noexcept |
| Extracts the element of the field labeled L from a kumi::record. | |
|
template<str Name> requires (concepts::contains_label<label_t<Name>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< Name >) &&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 Name> requires (concepts::contains_label<label_t<Name>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< Name >) 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 Name> requires (concepts::contains_label<label_t<Name>, Ts...>) | |
| constexpr decltype(auto) | operator[] (label_t< Name >) 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::contains_field<Id, Ts...>) | |
| constexpr decltype(auto) | operator[] (Id const &) &noexcept |
| Extracts the element whose identifier matches Id from a kumi::record. | |
|
template<concepts::identifier Id> requires (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::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::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. | |
Properties | |
| constexpr auto | values () noexcept |
| Returns references to the values of the element in a kumi::record. | |
| constexpr auto | values () const noexcept |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static constexpr auto | size () noexcept |
| static constexpr bool | empty () noexcept |
| static constexpr auto | identifiers () noexcept |
| Returns the identifiers associated to the elements of a kumi::record. | |
| static constexpr auto | labels () noexcept |
| Returns the labels associated to the elements of a kumi::record. | |
Comparison operators | |
|
template<typename... Us> requires (concepts::named_equality_comparable<record, record<Us...>>) | |
| constexpr auto | operator== (record const &self, record< Us... > const &other) noexcept |
| Compares a record with an other for equality. | |
|
template<typename... Us> requires (concepts::named_equality_comparable<record, record<Us...>>) | |
| constexpr auto | operator!= (record const &self, record< Us... > const &other) noexcept |
| Compares a record with an other for inequality. | |
Record Deduction Guides | |
| template<typename... Ts> | |
| KUMI_CUDA | record (Ts &&...) -> record< std::unwrap_ref_decay_t< Ts >... > |
| kumi::record deduction guide | |
Record accessors | |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &r) noexcept |
| Extracts the Ith field from a kumi::record. | |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &&r) noexcept |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &r) noexcept |
| template<std::size_t I, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &&r) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &r) noexcept |
| Extracts the element of the field labeled L from a kumi::record if it exists. | |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &&r) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &r) noexcept |
| template<str L, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &&r) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &r) noexcept |
| Extracts the field identified by Id from a kumi::record if it exists. | |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &&r) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &r) noexcept |
| template<concepts::identifier auto Id, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &&r) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &r) noexcept |
| Extracts the field which underlying type is T from a kumi::record if it exist. | |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &&r) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &r) noexcept |
| template<typename T, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > const &&r) noexcept |