Fixed-size collection of heterogeneous fields necessarily named, names are unique. More...
#include <kumi/product_types/record.hpp>
Fixed-size collection of heterogeneous fields necessarily named, names 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. |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename Target , product_type T> | |
| decltype(auto) constexpr | get (T &&t) noexcept |
| Extracts the value with type Target of a kumi::product_type. | |
| template<str Name, product_type T> | |
| decltype(auto) constexpr | get (T &&t) noexcept |
| Extracts the values of the fields of a kumi::product_type. | |
Record construction | |
| template<str... Fields, typename... Ts> | |
| constexpr auto | forward_as_record (Ts &&... ts) -> record< field_capture< Fields, Ts && >... > |
| Creates a kumi::record of forwarding references to its arguments. | |
| template<typename... Ts> | |
| constexpr auto | make_record (Ts &&...ts) -> record< std::unwrap_ref_decay_t< Ts >... > |
| Creates a record object, deducing the target type from the types of arguments. | |
| template<record_type Type> | |
| constexpr auto | to_ref (Type &&r) |
| Creates a kumi::record of references given a reference to a kumi::record_type. | |
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<str Name, typename... Ts> | |
| decltype(auto) constexpr | get (record< Ts... > &r) noexcept |
| Extracts the element of the field labeled Name from a kumi::record if it exists. | |