4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt::record Namespace Reference

Classes

struct  element
 An element of a record. More...
 
class  element_init
 The type produced by initializing a single record element. More...
 
struct  is_element
 Tests if a type is an fcppt::record::element. More...
 
struct  is_element< fcppt::record::element< Type, Tag > >
 
struct  is_label
 Tests if a type is an fcppt::record::label. More...
 
struct  is_label< fcppt::record::label< Tag > >
 
struct  is_object
 Tests if a type is an fcppt::record::object. More...
 
struct  is_object< fcppt::record::object< Elements... > >
 
struct  label
 A type identifying an element of a record. More...
 
class  object
 A generic struct that identifies elements by types. More...
 

Typedefs

template<fcppt::mpl::list::object_concept Records>
using all_disjoint
 Tests if multiple records have disjoint label sets.
 
template<typename RecordL , typename RecordR >
using are_disjoint
 Tests if two records have disjoint label sets.
 
template<typename Record1 , typename Record2 >
using are_equivalent
 Tests if two records have the same element maps.
 
template<typename RecordL , typename RecordR >
using disjoint_product = typename fcppt::record::detail::disjoint_product<RecordL, RecordR>::type
 The product of two disjoint records.
 
template<typename Type >
using element_init_tag = typename fcppt::record::detail::element_init_tag<Type>::type
 The tag type of fcppt::record::element_init.
 
template<typename Type >
using element_init_type = typename fcppt::record::detail::element_init_type<Type>::type
 The value type of fcppt::record::element_init.
 
template<typename Record >
using element_map
 A metafunction computing the element map of a record.
 
template<typename Record >
using element_tag_tuple
 A metafunction returning the elements of record as a fcppt::tuple::object of fcppt::tag types.
 
template<typename Element >
using element_to_label = typename fcppt::record::detail::element_to_label<Element>::type
 Extracts the type of an fcppt::record::element.
 
template<typename Element >
using element_to_type
 Extracts the label of an element.
 
template<typename Record >
using element_vector = typename fcppt::record::detail::element_vector<Record>::type
 A metafunction returning the elements of record as an MPL vector.
 
template<fcppt::mpl::list::object_concept List>
using from_list = fcppt::mpl::list::as<fcppt::record::object, List>
 Declares a record using an mpl::list.
 
template<typename Record , typename Label >
using has_label = fcppt::mpl::set::contains<fcppt::record::label_set<Record>, Label>
 Tests if a record has an fcppt::record::label.
 
template<typename... Args>
using is_vararg_ctor
 Checks if a parameter pack is suitable for record initialization.
 
template<typename Record >
using label_set
 The set of labels of a record.
 
template<typename Record , typename Label >
using label_value_type
 Metafunction that computes the value type of a label inside a record.
 
template<typename Record , typename Function >
using map_elements
 Maps the elements of a vector using a metafunction.
 
template<typename Record , typename Function >
using map_result
 The result of mapping a record.
 

Functions

template<typename... Types1, typename... Types2>
bool operator== (fcppt::record::object< Types1... > const &_record1, fcppt::record::object< Types2... > const &_record2)
 Compares two records for equality.
 
template<typename... Types1, typename... Types2>
bool operator!= (fcppt::record::object< Types1... > const &_record1, fcppt::record::object< Types2... > const &_record2)
 Compares two records for inequality.
 
template<typename Label , typename... Elements>
fcppt::record::label_value_type< fcppt::record::object< Elements... >, Label > const & get (fcppt::record::object< Elements... > const &_arg)
 Gets an element from a record.
 
template<typename Label , typename... Elements>
fcppt::record::label_value_type< fcppt::record::object< Elements... >, Label > & get (fcppt::record::object< Elements... > &_arg)
 Gets an element from a record.
 
template<typename Result , typename Function >
Result init (Function const &_function)
 Initializes a record using a function.
 
template<typename Label >
std::string label_name ()
 Returns the name of a label as a string.
 
template<typename... Args>
requires ( fcppt::mpl::list::distinct<fcppt::mpl::list::object< fcppt::record::label<fcppt::record::element_init_tag<Args>>...>>::value && fcppt::record::is_vararg_ctor<Args...>::value)
fcppt::record::object< fcppt::record::element< fcppt::record::label< fcppt::record::element_init_tag< Args > >, fcppt::record::element_init_type< Args > >... > make (Args &&..._args)
 Creates a record from an initializer list.
 
template<typename Record , typename Function >
fcppt::record::map_result< Record, Function > map (Record &&_record, Function const &_function)
 Maps a record using a function.
 
template<typename Record1 , typename Record2 >
fcppt::record::disjoint_product< std::remove_cvref_t< Record1 >, std::remove_cvref_t< Record2 > > multiply_disjoint (Record1 &&_record1, Record2 &&_record2)
 Creates the disjoint product of two records.
 
template<typename Ch , typename Traits , typename... Elements>
std::basic_ostream< Ch, Traits > & operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::record::object< Elements... > const &_record)
 Outputs a record to a stream.
 
template<typename Result , typename Arg >
Result permute (Arg &&_arg)
 Permutes one record into another.
 
template<typename Label , typename... Elements>
void set (fcppt::record::object< Elements... > &_arg, fcppt::record::label_value_type< fcppt::record::object< Elements... >, Label > const &_value)
 Sets an element in a record by copy.
 
template<typename Label , typename... Elements>
void set (fcppt::record::object< Elements... > &_arg, fcppt::record::label_value_type< fcppt::record::object< Elements... >, Label > &&_value)
 Sets an element in a record by move.
 

Variables

template<fcppt::mpl::list::object_concept Records>
constexpr bool all_disjoint_v = fcppt::record::all_disjoint<Records>::value
 Tests if multiple records have disjoint label sets.
 
template<typename RecordL , typename RecordR >
constexpr bool are_disjoint_v = fcppt::record::are_disjoint<RecordL, RecordR>::value
 Tests if two records have disjoint label sets.
 
template<typename Record1 , typename Record2 >
constexpr bool are_equivalent_v = fcppt::record::are_equivalent<Record1, Record2>::value
 Tests if two records have the same element maps.