Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
tuples::TaggedTuple< Tags > Class Template Reference

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

#include <TaggedTuple.hpp>

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) noexcept(tuples_detail::all< std::is_nothrow_constructible< tuples_detail::TaggedTupleLeaf< Tags >, Us >::value... >::value)
 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) noexcept(//NOLINT tuples_detail::all< std::is_nothrow_constructible< tuples_detail::TaggedTupleLeaf< Tags >, Us >::value... >::value)
 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) noexcept(tuples_detail::all< std::is_nothrow_constructible< tag_type< Tags >, tag_type< UTags > const &>::value... >::value)
 
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) noexcept(tuples_detail::all< std::is_nothrow_constructible< tag_type< Tags >, tag_type< UTags > &&>::value... >::value)
 
TaggedTupleoperator= (typename std::conditional< is_copy_assignable::value, TaggedTuple, tuples_detail::no_such_type >::type const &t) noexcept(is_nothrow_copy_assignable::value)
 
TaggedTupleoperator= (typename std::conditional< is_move_assignable::value, TaggedTuple, tuples_detail::no_such_type >::type &&t) noexcept(is_nothrow_move_assignable::value)
 
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) noexcept(tuples_detail::all< std::is_nothrow_assignable< tag_type< Tags > &, tag_type< UTags > const &>::value... >::value)
 
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) noexcept(tuples_detail::all< std::is_nothrow_assignable< tag_type< Tags > &, tag_type< UTags > &&>::value... >::value)
 
void swap (TaggedTuple &t) noexcept(tuples_detail::all< tuples_detail::is_nothrow_swappable_with< tuples_detail::TaggedTupleLeaf< Tags >, tuples_detail::TaggedTupleLeaf< Tags >>::value... >::value)
 

Static Public Member Functions

static constexpr size_t size () noexcept
 

Friends

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

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)
inlineexplicitnoexcept

Construct a TaggedTuple with Args.

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

Example

◆ 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)
inlinenoexcept

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: