SpECTRE  v2024.02.05
tuples::TaggedTuple< Tags > Class Template Reference

An associative container that is indexed by structs. More...

Public Types

using tags_list = tmpl::list< Tags... >
 

Public Member Functions

void pup (PUP::er &p)
 
 TaggedTuple (TaggedTuple const &)=default
 
 TaggedTuple (TaggedTuple &&)=default
 
template<class... Us, typename std::enable_if< args_constructor< not pack_is_TaggedTuple< Us... >::value and sizeof...(Us)==sizeof...(Tags)>::template enable_explicit< Us... >()>::type * = nullptr>
constexpr TaggedTuple (Us &&... us)
 Construct a TaggedTuple with Args. More...
 
template<class... Us, typename std::enable_if< args_constructor< not pack_is_TaggedTuple< Us... >::value and sizeof...(Us)==sizeof...(Tags)>::template enable_implicit< Us... >()>::type * = nullptr>
constexpr TaggedTuple (Us &&... us)
 Construct a TaggedTuple with Args. More...
 
template<class... UTags, typename std::enable_if< sizeof...(Tags)==sizeof...(UTags) and tuples_detail::all< std::is_constructible< tag_type< Tags >, const tag_type< UTags > & >::value... >::value and not tuples_detail::all< std::is_same< Tags, UTags >::value... >::value >::type * = nullptr>
constexpr TaggedTuple (TaggedTuple< UTags... > const &t)
 
template<class... UTags, typename std::enable_if< sizeof...(Tags)==sizeof...(UTags) and tuples_detail::all< std::is_constructible< tag_type< Tags >, tag_type< UTags > && >::value... >::value and not tuples_detail::all< std::is_same< Tags, UTags >::value... >::value >::type * = nullptr>
constexpr TaggedTuple (TaggedTuple< UTags... > &&t)
 
TaggedTupleoperator= (tmpl::conditional_t< is_copy_assignable::value, TaggedTuple, tuples_detail::no_such_type > const &t)
 
TaggedTupleoperator= (tmpl::conditional_t< is_move_assignable::value, TaggedTuple, tuples_detail::no_such_type > &&t)
 
template<class... UTags, typename std::enable_if< sizeof...(Tags)==sizeof...(UTags) and tuples_detail::all< std::is_assignable< tag_type< Tags > &, tag_type< UTags > const & >::value... >::value >::type * = nullptr>
TaggedTupleoperator= (TaggedTuple< UTags... > const &t)
 
template<class... UTags, typename std::enable_if< sizeof...(Tags)==sizeof...(UTags) and tuples_detail::all< std::is_assignable< tag_type< Tags > &, tag_type< UTags > && >::value... >::value >::type * = nullptr>
TaggedTupleoperator= (TaggedTuple< UTags... > &&t)
 
void swap (TaggedTuple &t)
 

Static Public Member Functions

static constexpr size_t size ()
 

Friends

template<class Tag , class... LTags>
constexpr const Tag::type & get (const TaggedTuple< LTags... > &t)
 
template<class Tag , class... LTags>
constexpr Tag::type & get (TaggedTuple< LTags... > &t)
 
template<class Tag , class... LTags>
constexpr const Tag::type && get (const TaggedTuple< LTags... > &&t)
 
template<class Tag , class... LTags>
constexpr Tag::type && get (TaggedTuple< LTags... > &&t)
 

Detailed Description

template<class... Tags>
class tuples::TaggedTuple< Tags >

An associative container that is indexed by structs.

A data structure that is indexed by Tags. A Tag is a struct that contains a type alias named type, which is the type of the object stored with index Tag.

Template Parameters
Tagsthe tags of the objects to be placed in the tuple

Constructor & Destructor Documentation

◆ TaggedTuple() [1/2]

template<class... Tags>
template<class... Us, typename std::enable_if< args_constructor< not pack_is_TaggedTuple< Us... >::value and sizeof...(Us)==sizeof...(Tags)>::template enable_explicit< Us... >()>::type * = nullptr>
constexpr tuples::TaggedTuple< Tags >::TaggedTuple ( Us &&...  us)
inlineexplicitconstexpr

Construct a TaggedTuple with Args.

Requires: std::is_convertible_v<Us, typename Tags::type>... is true

Example

"bla", 17, "bla@bla.bla", std::vector<std::string>{"Mom", "Dad"}, 0);
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:261

◆ TaggedTuple() [2/2]

template<class... Tags>
template<class... Us, typename std::enable_if< args_constructor< not pack_is_TaggedTuple< Us... >::value and sizeof...(Us)==sizeof...(Tags)>::template enable_implicit< Us... >()>::type * = nullptr>
constexpr tuples::TaggedTuple< Tags >::TaggedTuple ( Us &&...  us)
inlineconstexpr

Construct a TaggedTuple with Args.

Requires: std::is_convertible_v<Us, typename Tags::type>... is true

Example


The documentation for this class was generated from the following file: