SpECTRE  v2025.03.17
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
tuples Namespace Reference

Contains utilities for working with tuples. More...

Classes

class  TaggedTuple
 An associative container that is indexed by structs. More...
 
class  TaggedTuple<>
 
struct  tuple_size
 
struct  tuple_size< const TaggedTuple< Tags... > >
 
struct  tuple_size< const volatile TaggedTuple< Tags... > >
 
struct  tuple_size< TaggedTuple< Tags... > >
 
struct  tuple_size< volatile TaggedTuple< Tags... > >
 

Typedefs

template<class Tag >
using tag_type = typename Tag::type
 Returns the type of the Tag.
 
template<typename T >
using tagged_tuple_from_typelist = implementation defined
 

Functions

template<size_t I, class... Tags>
constexpr tmpl::at_c< tmpl::list< Tags... >, I >::type && get (TaggedTuple< Tags... > &&t)
 
template<size_t I, class... Tags>
constexpr const tmpl::at_c< tmpl::list< Tags... >, I >::type & get (const TaggedTuple< Tags... > &t)
 
template<size_t I, class... Tags>
constexpr tmpl::at_c< tmpl::list< Tags... >, I >::type & get (TaggedTuple< Tags... > &t)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator== (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator!= (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator< (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator> (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator<= (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... LTags, class... RTags, typename std::enable_if< sizeof...(LTags)==sizeof...(RTags)>::type * = nullptr>
TUPLES_LIB_CONSTEXPR_CXX_14 bool operator>= (TaggedTuple< LTags... > const &lhs, TaggedTuple< RTags... > const &rhs)
 
template<class... Tags, typename std::enable_if< tuples_detail::all< tuples_detail::is_swappable_with< tuples_detail::TaggedTupleLeaf< Tags >, tuples_detail::TaggedTupleLeaf< Tags > >::value... >::value >::type * = nullptr>
void swap (TaggedTuple< Tags... > &lhs, TaggedTuple< Tags... > &rhs)
 
template<typename ReturnedTaggedTuple , typename... Tags>
ReturnedTaggedTuple reorder (TaggedTuple< Tags... > input)
 Given an input TaggedTuple, produce an output TaggedTuple with the tags in a different order. All tags must be the same except for ordering. More...
 
template<class... Tags>
std::ostreamoperator<< (std::ostream &os, const TaggedTuple< Tags... > &t)
 
template<class Tag , class... Tags>
constexpr const Tag::type & get (const TaggedTuple< Tags... > &t)
 Retrieve the element of Tag in the TaggedTuple.
 
template<class Tag , class... Tags>
constexpr Tag::type & get (TaggedTuple< Tags... > &t)
 Retrieve the element of Tag in the TaggedTuple.
 
template<class Tag , class... Tags>
constexpr const Tag::type && get (const TaggedTuple< Tags... > &&t)
 Retrieve the element of Tag in the TaggedTuple.
 
template<class Tag , class... Tags>
constexpr Tag::type && get (TaggedTuple< Tags... > &&t)
 Retrieve the element of Tag in the TaggedTuple.
 
template<typename ApplyTags , typename F , typename... Tags>
constexpr decltype(auto) apply (F &&f, const TaggedTuple< Tags... > &t)
 Invoke f with the ApplyTags taken from t expanded in a parameter pack. More...
 
template<typename F , typename... Tags>
constexpr decltype(auto) apply (F &&f, const TaggedTuple< Tags... > &t)
 Invoke f with the ApplyTags taken from t expanded in a parameter pack. More...
 

Detailed Description

Contains utilities for working with tuples.

Function Documentation

◆ reorder()

template<typename ReturnedTaggedTuple , typename... Tags>
ReturnedTaggedTuple tuples::reorder ( TaggedTuple< Tags... >  input)

Given an input TaggedTuple, produce an output TaggedTuple with the tags in a different order. All tags must be the same except for ordering.

Example

const auto test4 = tuples::reorder<
std::move(test));
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:264
ReturnedTaggedTuple reorder(TaggedTuple< Tags... > input)
Given an input TaggedTuple, produce an output TaggedTuple with the tags in a different order....
Definition: TaggedTuple.hpp:693