|
KUMI v5.0.0
Gorgeous Garnet
|
Main KUMI namespace. More...
Main KUMI namespace.
Classes | |
| struct | apply_traits |
| Unpacks a product type and applies its element types as arguments to a meta-function. More... | |
| class | as |
| Lightweight type-wrapper. More... | |
| struct | as_tuple |
| Generate a kumi::tuple type from a type. More... | |
| class | builder |
| kumi::builder provides a generic way of defining a product type. More... | |
| struct | common_product_type |
| Extracts the common product_type of a parameter pack. More... | |
| class | field |
| Named wrapper over a type. More... | |
| struct | field< Id, T > |
| Specialisation to clearly indicate an error. More... | |
| class | identifier |
| identifier definition class More... | |
| class | index_t |
| Integral constant type. More... | |
| class | label_t |
| Literal constant type. More... | |
| struct | map_traits |
| Applies a unary meta-function to each element of a product type. More... | |
| class | name |
| Compile-time text based identifier. More... | |
| class | projection_map |
| A stateless, compile-time schema for product type transformation. More... | |
| class | record |
| Fixed-size collection of heterogeneous tagged fields, tags are unique. More... | |
| struct | stored_element |
| Provides indexed access to the types of the elements of a product type and unwraps the returned field for record type. More... | |
| struct | stored_member |
| Computes the return type of a call to kumi::get on a kumi::tuple and unwrap the field returned by kumi::get on a kumi::record. More... | |
| class | str |
| Static string used to create named fields. More... | |
| class | tuple |
| Fixed-size collection of heterogeneous values. More... | |
| class | unit |
| A type representing the product of no type, also called the unit type. More... | |
| class | unknown |
| Type indicating an identifier was not found in a given kumi::product_type. More... | |
Typedefs | |
| template<typename T> | |
| using | container_type_t = decltype(kumi_implementation_defined(std::declval<T>())) |
| Provides access to the type of the elements of a kumi::concepts::container. | |
| template<std::size_t I, typename T> | |
| using | element_t = std::tuple_element_t<I, std::remove_cvref_t<T>> |
| Provides indexed access to the types of the elements of a kumi::product_type. | |
| template<std::size_t I, typename T> | |
| using | member_t = decltype(get<I>(std::declval<T&&>())) |
| Computes the return type of a call to kumi::get. | |
Functions | |
| template<typename C, typename... Ts> requires (std::is_move_constructible_v<std::decay_t<C>> && (std::is_move_constructible_v<std::decay_t<Ts>> && ...)) | |
| constexpr auto | bind_back (C &&c, Ts &&... ts) noexcept(std::is_nothrow_move_constructible_v< std::decay_t< C > > &&(std::is_nothrow_move_constructible_v< std::decay_t< Ts > > &&...)) |
| Returns a callable object with ts bound as its trailing arguments, reducing c arity. | |
| template<typename C, typename... Ts> requires (std::is_move_constructible_v<std::decay_t<C>> && (std::is_move_constructible_v<std::decay_t<Ts>> && ...)) | |
| constexpr auto | bind_front (C &&c, Ts &&... ts) noexcept(std::is_nothrow_move_constructible_v< std::decay_t< C > > &&(std::is_nothrow_move_constructible_v< std::decay_t< Ts > > &&...)) |
| Returns a callable object with ts bound as its leading arguments, reducing c arity. | |
| template<kumi_implementation_defined auto Name, typename T> | |
| decltype(auto) constexpr | capture_field (T &&t) noexcept |
| Creates a field from a given value keeping the qualifiers. | |
| template<typename U, typename T> | |
| decltype(auto) constexpr | field_cast (T &&t) noexcept |
| Casts the provided value to the target type using static_cast. | |
| template<typename T> | |
| constexpr decltype(auto) | field_value_of (T &&t) noexcept |
| Extracts the value from a kumi::concepts::field or returns the parameter. | |
| template<kumi::concepts::identifier Id, kumi::concepts::product_type T> requires (kumi::concepts::queryable_by_identifier<Id, T>) | |
| consteval auto | get_index_of_field () |
| Helper to retrieve the index of a type in a product type by its identifier. | |
| template<kumi::str L, kumi::concepts::product_type T> requires (kumi::concepts::queryable_by_label<kumi::label_t<L>, T>) | |
| consteval auto | get_index_of_label () |
| Helper to retrieve the index of a type in a product type by its identifier. | |
| template<typename U, kumi::concepts::product_type T> requires (kumi::concepts::queryable_by_type<U, T>) | |
| consteval auto | get_index_of_type () |
| Helper to retrieve the index of a type in a product type by its type. | |
| template<typename T> | |
| consteval auto | identifier_of () noexcept |
| Extracts the identifiers from a kumi::concepts::field or returns the parameter. | |
| template<kumi::concepts::identifier... Ts> | |
| consteval auto | identifiers (Ts...) noexcept |
| Creates a kumi::projection_map object, deducing the target type from the types of arguments. | |
| template<kumi::concepts::index... Ts> | |
| consteval auto | indexes (Ts...) noexcept |
| Creates a kumi::projection_map object, deducing the target type from the types of arguments. | |
| template<typename C, typename... Ts> | |
| constexpr decltype(auto) | invoke (C &&c, Ts &&... ts) |
| Invoke the Callable object c with a pack of arguments. | |
| template<typename R, typename C, typename... Ts> requires (std::is_invocable_r_v<R, C, Ts...>) | |
| constexpr R | invoke_r (C &&c, Ts &&... ts) noexcept(std::is_nothrow_invocable_r_v< R, C, Ts... >) |
| Invoke the Callable object c with a pack of arguments with return type R. | |
| template<typename T> | |
| consteval kumi::str | label_of () noexcept |
| Extracts the label from a kumi::concepts::field or returns the parameter. | |
| template<std::convertible_to< std::size_t > auto... vs> | |
| consteval auto | make_indexes () noexcept |
| Creates a kumi::projection_map object, deducing the target type from the types of arguments. | |
| template<char... c> | |
| constexpr auto | operator""_c () noexcept |
| Forms a integral constant literal of the desired value. | |
| template<kumi::str ID> | |
| constexpr auto | operator""_id () noexcept |
| Forms a constant string literal of the desired value. | |
| template<kumi::str ID> | |
| constexpr auto | operator""_l () noexcept |
| Forms a constant string literal of the desired value. | |
| template<kumi::concepts::identifier L, kumi::concepts::identifier R> | |
| constexpr bool | operator== (L const &, R const &) |
| identifier comparison | |
| template<template< class > class Pred> | |
| constexpr auto | predicate () noexcept |
| Convert a unary template meta-program in a running predicate. | |
| template<kumi::concepts::projection... Ts> | |
| projection_map (Ts...) -> projection_map< Ts | |
| kumi::projection_map deduction guide | |
Variables | |
| constexpr all_of_t | all_of {} |
| Callable object checking if a unary predicate p returns true for every element of t. | |
| constexpr all_unique_t | all_unique {} |
| Callable object returning a product type containing the values of the first occurrence of each type in t. | |
| template<typename... Ts> | |
| constexpr bool | all_unique_names_v = kumi_implementation_defined |
| Checks if a parameter pack only contains distinct kumi::field names. Evaluates to false if no type is a kumi::field. | |
| template<typename... Ts> | |
| constexpr bool | all_uniques_v = kumi_implementation_defined |
| Checks if a parameter pack only contains distinct types. | |
| constexpr any_of_t | any_of {} |
| Callable object checking if a unary predicate p returns true for any element of t. | |
| constexpr apply_t | apply {} |
| Callable object invoking the callable object f with the elements of the product type unrolled as arguments. | |
| constexpr apply_field_t | apply_field {} |
| Callable object invoking the callable object f with the elements of the product type unrolled as arguments. | |
| constexpr as_flat_ptr_t | as_flat_ptr {} |
| Callable object converting recursively a product type of product types into a flat product type of pointers to each of its components. | |
| constexpr back_t | back {} |
| Callable object used to retrieve the back of a product type. | |
| constexpr bit_and_t | bit_and {} |
| Callable object computing the bitwise AND of all elements. | |
| constexpr bit_or_t | bit_or {} |
| Callable object computing the bitwise OR of all elements. | |
| constexpr bit_xor_t | bit_xor {} |
| Callable object computing the bitwise XOR of all elements. | |
| constexpr cartesian_product_t | cartesian_product {} |
| Callable object returning the Cartesian Product of all elements of its arguments product types. | |
| constexpr cat_t | cat {} |
| Callable object concatenating multiple product types into a single one. | |
| template<std::size_t N> | |
| constexpr tiles_t< N, N > | chunks {} |
| Callable object creating a tuple of product types, each containing N consecutive elements from t. Chunks starts at 0 and advance by N element each time. | |
| constexpr compress_t | compress {} |
| Callable object converting a product type of product type into a single product type recursively, or returns the input. | |
| template<typename T> | |
| constexpr std::size_t | container_size_v = kumi_implementation_defined |
| Returns the statically known number of elements of a kumi::container. | |
| constexpr contains_t | contains {} |
| Callable object checking if a product type contains a given identifier. | |
| constexpr contains_any_t | contains_any {} |
| Callable object checking if a product type contains at least one of many identifier. | |
| constexpr contains_none_t | contains_none {} |
| Callable object checking if a product type contains no fields based on any of the selected identifiers. | |
| constexpr contains_only_t | contains_only {} |
| Callable object checking if a product type contains fields based on a selected identifier. | |
| constexpr count_t | count {} |
| Callable object counting the number of elements of t not equivalent to false. | |
| constexpr count_if_t | count_if {} |
| Callable object counting the number of elements of t satisfying predicates p. | |
| constexpr exclusive_scan_left_t | exclusive_scan_left {} |
| Callable object computing the exclusive prefix scan of all elements of a product type using a tail recursive call. | |
| constexpr exclusive_scan_right_t | exclusive_scan_right {} |
| Callable object computing the exclusive suffix scan of all elements of a product type using a non-tail recursive call. | |
| constexpr extract_t | extract {} |
| Callable object extracting a sub product type from a product type. | |
| template<std::size_t N> | |
| constexpr fill_t< N > | fill {} |
| Callable object creating a kumi::tuple containing N copies of v. | |
| template<template< typename > typename Pred> | |
| constexpr filter_t< Pred > | filter {} |
| Callable object filtering a product type over a predicate. | |
| template<template< typename > typename Pred> | |
| constexpr filter_not_t< Pred > | filter_not {} |
| Callable object filtering a product type over a predicate. | |
| constexpr flatten_t | flatten {} |
| Callable object converting a product type of product types into a product type of all elements. | |
| constexpr flatten_all_t | flatten_all {} |
| Callable object converting recursively a product type of product types into a product type of all elements. | |
| constexpr fold_left_t | fold_left {} |
| Callable object computing the generalized combination of all elements using a tail recursive call. | |
| constexpr fold_right_t | fold_right {} |
| Callable object computing the generalized combination of all elements using a non-tail recursive call. | |
| constexpr for_each_t | for_each {} |
| Callable object applying the Callable object f on each element of a product type. | |
| constexpr for_each_field_t | for_each_field {} |
| Callable object applying the Callable object f on each element of a product type and its field. | |
| constexpr for_each_index_t | for_each_index {} |
| Callable object applying the Callable object f on each element of a product type and its index. | |
| constexpr front_t | front {} |
| Callable object used to retrieve the front of a product type. | |
| template<std::size_t N> | |
| constexpr generate_t< N > | generate {} |
| Callable object creating a kumi::tuple containing N applications of the f Callable. | |
| template<typename T> | |
| constexpr bool | has_static_size_v |
| Detects if a given kumi::container instance size is static. | |
| template<template< class > typename Traits> | |
| constexpr traits_check< Traits > | if_ = {} |
| Option restricting an identifier to accept values whose type satisfies the trait Traits. | |
| constexpr inclusive_scan_left_t | inclusive_scan_left {} |
| Callable object computing the inclusive prefix scan of all elements of a product type using a tail recursive call. | |
| constexpr inclusive_scan_right_t | inclusive_scan_right {} |
| Callable object computing the inclusive suffix scan of all elements of a product type using a non-tail recursive call. | |
| template<std::size_t N> | |
| constexpr kumi::index_t< N > const | index = {} |
| Inline integral constant value for kumi::index_t. | |
| constexpr inner_product_t | inner_product {} |
| Callable object computing the inner product (i.e. sum of products). | |
| template<std::size_t N> | |
| constexpr iota_t< N > | iota {} |
| Callable object creating a kumi::tuple containing an increasing ramp of values. | |
| template<typename T> | |
| constexpr bool | is_container_v = kumi_implementation_defined |
| Traits detecting types behaving like a kumi::container. | |
| template<typename T, typename U> | |
| constexpr bool | is_equality_comparable_v = false |
| Checks if two product types are comparable for equality. | |
| template<typename T, typename U> | |
| constexpr bool | is_equivalent_v = false |
| Checks if two product types are equivalent. | |
| template<typename T> | |
| constexpr bool | is_homogeneous_v = false |
| Detects if a given kumi::product_type instance is homogeneous. | |
| template<typename T, typename U> | |
| constexpr bool | is_instance_of_v = false |
| Checks if a type is an instance of a specific template. | |
| template<typename T> | |
| constexpr bool | is_product_type_v = kumi_implementation_defined |
| Detects if a type follows the tuple protocol. | |
| template<typename T> | |
| constexpr bool | is_projection_map_v = requires { T::is_projection_map; } |
| Checks if a type can be used as a kumi::projection_map. | |
| template<typename T> | |
| constexpr bool | is_record_type_v = requires { typename T::is_record_type; } && kumi_implementation_defined |
| Opt-in traits for types behaving like a kumi::record_type. | |
| template<str Label> | |
| constexpr kumi::label_t< Label > | label = {} |
| Inline literal constant value for kumi::label_t. | |
| constexpr locate_t | locate {} |
| Callable object returning the index of a value whose type satisfies a given predicate. | |
| constexpr map_t | map {} |
| Callable object applying the Callable object f on each product types' elements. | |
| constexpr map_field_t | map_field {} |
| Callable object applying the Callable object f on each product types elements and their associated labels. | |
| constexpr map_index_t | map_index {} |
| Callable object applying the Callable object f on each product types elements and their indexes. | |
| constexpr map_reduce_t | map_reduce {} |
| Callable object performing a tree-like reduction of all elements of a product type. The given map function is applied before executing the reduction to each element of the input. | |
| constexpr max_t | max {} |
| Callable object computing the maximum value of all elements of t. | |
| constexpr max_flat_t | max_flat {} |
| Callable object computing the maximum value of applications of f to all elements of kumi::flatten_all(t). | |
| template<typename T> | |
| constexpr member_cast_t< T > | member_cast {} |
| Callable object converting a product_type<Ts...> to an instance of a product_type<Target...>. | |
| constexpr min_t | min {} |
| Callable object computing the minimum value of all elements of t. | |
| constexpr min_flat_t | min_flat {} |
| Callable object computing the minimum value of applications of f to all elements of kumi::flatten_all(t). | |
| constexpr kumi::unit | none {} |
| Inline constant representing a kumi::unit. | |
| constexpr none_of_t | none_of {} |
| Callable object checking if a unary predicate p does not return true for any element in t. | |
| template<typename T> | |
| constexpr kumi::only_t< T > | only = {} |
| Option restricting an identifier to accept a single type T. | |
| template<template< typename > typename Pred> | |
| constexpr partition_t< Pred > | partition {} |
| Callable object partitioning a product type over a predicate. | |
| constexpr pop_back_t | pop_back {} |
| Callable object removing the last (if any) element of t. | |
| constexpr pop_front_t | pop_front {} |
| Callable object removing the first (if any) element of t. | |
| constexpr prod_t | prod {} |
| Callable object computing the product of all elements. | |
| constexpr push_back_t | push_back {} |
| Callable object constructing a product type by adding a value v at the end of t. | |
| constexpr push_front_t | push_front {} |
| Callable object constructing a product type by adding a value v at the beginning of t. | |
| constexpr reduce_t | reduce {} |
| Callable object performing a tree-like reduction of all elements of a product type. | |
| template<kumi::concepts::projection_map auto Projections> | |
| constexpr reindex_t< Projections > | reindex {} |
| Callable object reindex elements of a Product Type. | |
| constexpr remove_t | remove {} |
| Callable object removing a sub product type from a product type. | |
| template<std::size_t... I> | |
| constexpr reorder_t< I... > | reorder {} |
| Callable object reordering elements of a product type. | |
| template<kumi::concepts::identifier auto... Name> | |
| constexpr reorder_fields_t< Name... > | reorder_fields {} |
| Callable object reordering elements of a Record Type. | |
| constexpr reverse_t | reverse {} |
| Callable object reversing elements of a product type. | |
| template<std::size_t R> | |
| constexpr rotate_left_t< R > | rotate_left {} |
| Callable object. | |
| template<std::size_t R> | |
| constexpr rotate_right_t< R > | rotate_right {} |
| Callable object. | |
| template<typename T> | |
| constexpr std::size_t | size_v = std::tuple_size<std::remove_cvref_t<T>>::value |
| Computes the number of elements of a kumi::product_type. | |
| constexpr split_t | split {} |
| Callable object splitting a product type into two. | |
| constexpr sum_t | sum {} |
| Callable object computing the sum of all elements. | |
| template<std::size_t N, std::size_t O> | |
| constexpr tiles_t< N, O > | tiles {} |
| Callable object creating a tuple of product types, each containing N consecutive elements from t. Tiles starts at 0 and advance by O element each time. | |
| constexpr transpose_t | transpose {} |
| Callable object transposing a product type of product types by shifting elements in their transposed position always returning a tuple as the external product type. | |
| constexpr unique_t | unique {} |
| Callable object returning a product type with consecutive duplicate types removed (pairwise uniqueness). | |
| template<std::size_t N> | |
| constexpr tiles_t< N, 1 > | windows {} |
| Callable object creating a tuple of product types, each containing N consecutive elements from t. Windows starts at 0 and advance by 1 element each time. | |
| constexpr zip_t | zip {} |
| Callable object constructing a tuple where the ith element is the product type of all ith elements of t,ts... | |
| constexpr zip_max_t | zip_max {} |
| Callable object constructing a tuple where the ith element is the product type of all ith elements of t,ts... | |
| constexpr zip_min_t | zip_min {} |
| Callable object constructing a tuple where the ith element is the product type of all ith elements of t,ts... | |
Record construction | |
| template<kumi::concepts::identifier auto... Fields> | |
| constexpr tie_as_record_t< Fields... > | tie_as_record {} |
| Creates a kumi::record of lvalue references to its arguments. | |
| template<kumi::concepts::identifier auto... Fields> | |
| constexpr forward_as_record_t< Fields... > | forward_as_record {} |
| Creates a kumi::record of forwarding references to its arguments. | |
| constexpr make_record_t | make_record {} |
| Creates a record object, deducing the target type from the types of arguments. | |
Record conversion | |
| template<kumi::concepts::record_type Type> | |
| constexpr from_record_t< Type > | from_record {} |
| Converts a kumi::record to an instance of an arbitrary type that models kumi::record_type. | |
| constexpr to_record_t | to_record {} |
| Converts a kumi::concepts::record_type to an instance of kumi::record. | |
Tuple construction | |
| constexpr tie_t | tie {} |
| Creates a kumi::tuple of lvalue references to its arguments. | |
| constexpr forward_as_tuple_t | forward_as_tuple {} |
| Creates a kumi::tuple of forwarding references to its arguments. | |
| constexpr make_tuple_t | make_tuple {} |
| Creates a tuple object, deducing the target type from the types of arguments. | |
| constexpr to_ref_t | to_ref {} |
| Callable object creating a kumi::concepts::product_type of references given a reference to a kumi::concepts::product_type. | |
Tuple properties | |
| constexpr members_of_t | members_of {} |
| Extracts the names of the fields of a kumi::product_type. | |
| constexpr values_of_t | values_of {} |
| Extracts the values of the fields of a kumi::product_type. | |
Tuple conversions | |
| template<typename Type> | |
| constexpr from_tuple_t< Type > | from_tuple {} |
| Converts a kumi::tuple to an instance of an arbitrary type. | |
| constexpr to_tuple_t | to_tuple {} |
| Converts a kumi::concepts::product_type to an instance of kumi::tuple. | |