Audacity 3.2.0
Namespaces | Classes | Typedefs | Functions | Variables
Tuple Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  is_tuple
 Type test metapredicate, for specializations of std::tuple only. More...
 
struct  is_tuple< std::tuple< Types... > >
 
struct  is_tuple_like
 Type test metapredicate, for more general tuple-like types. More...
 
struct  is_tuple_like< T, std::void_t< decltype(std::tuple_size< T >{})> >
 

Typedefs

template<typename Tuple >
using All_t = decltype(All(std::declval< Tuple >()))
 Type of projection of all of a tuple. More...
 
template<typename Tuple >
using ForwardAll_t = decltype(ForwardAll(std::declval< Tuple >()))
 Type of forwarding references to all members of a tuple. More...
 
template<typename Tuple >
using Next_t = decltype(Next(std::declval< Tuple >()))
 Type of projection of the tail of a tuple. More...
 
template<typename Tuple >
using ForwardNext_t = decltype(ForwardNext(std::declval< Tuple >()))
 Type of forwarding references to tail members of a tuple. More...
 

Functions

template<typename Tuple >
constexpr bool Empty (const Tuple &tuple)
 
template<size_t... Indices, typename Tuple >
auto Projection (const std::index_sequence< Indices... > &, Tuple &&tuple)
 Destructures a std::index_sequence argument. More...
 
template<size_t... Indices, typename Tuple >
constexpr auto ForwardingProjection (const std::index_sequence< Indices... > &, Tuple &&tuple)
 Destructures a std::index_sequence argument. More...
 
template<typename Tuple >
auto All (Tuple &&tuple)
 Projection of all of a tuple. More...
 
template<typename Tuple >
auto ForwardAll (Tuple &&tuple)
 Forwarding of all of a tuple. More...
 
template<typename Tuple , typename Decayed = std::decay_t<Tuple>, auto Length = std::tuple_size_v<Decayed>, typename sfinae = std::enable_if_t<(Length > 0)>>
auto Next (Tuple &&tuple)
 Projection of the tail of a tuple. More...
 
template<typename Tuple , typename Decayed = std::decay_t<Tuple>, auto Length = std::tuple_size_v<Decayed>, typename sfinae = std::enable_if_t<(Length > 0)>>
auto ForwardNext (Tuple &&tuple)
 Forwarding of the tail of a tuple. More...
 

Variables

template<typename T >
static constexpr auto is_tuple_v = is_tuple<T>::value
 
template<typename T >
static constexpr auto is_tuple_like_v
 
template<typename Tuple >
constexpr bool Empty_v
 
template<size_t... Indices>
constexpr auto Project
 Return a tuple of values initialized from a subsequence of a tuple. More...
 
template<size_t... Indices>
constexpr auto ForwardProject
 Forwarding of a subsequence of a tuple. More...
 

Typedef Documentation

◆ All_t

template<typename Tuple >
using Tuple::All_t = typedef decltype(All(std::declval<Tuple>()))

Type of projection of all of a tuple.

Definition at line 127 of file Tuple.h.

◆ ForwardAll_t

template<typename Tuple >
using Tuple::ForwardAll_t = typedef decltype(ForwardAll(std::declval<Tuple>()))

Type of forwarding references to all members of a tuple.

Definition at line 137 of file Tuple.h.

◆ ForwardNext_t

template<typename Tuple >
using Tuple::ForwardNext_t = typedef decltype(ForwardNext(std::declval<Tuple>()))

Type of forwarding references to tail members of a tuple.

Definition at line 168 of file Tuple.h.

◆ Next_t

template<typename Tuple >
using Tuple::Next_t = typedef decltype(Next(std::declval<Tuple>()))

Type of projection of the tail of a tuple.

Definition at line 153 of file Tuple.h.

Function Documentation

◆ All()

template<typename Tuple >
auto Tuple::All ( Tuple &&  tuple)

Projection of all of a tuple.

Definition at line 120 of file Tuple.h.

120 {
121 constexpr auto Length = std::tuple_size_v<std::decay_t<Tuple>>;
122 return Projection(
123 std::make_index_sequence<Length>{}, std::forward<Tuple>(tuple));
124}
auto Projection(const std::index_sequence< Indices... > &, Tuple &&tuple)
Destructures a std::index_sequence argument.
Definition: Tuple.h:91

References Projection().

Referenced by Registry::detail::MakeTuple_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Empty()

template<typename Tuple >
constexpr bool Tuple::Empty ( const Tuple &  tuple)
constexpr

Definition at line 41 of file Tuple.h.

42{
43 return Empty_v<Tuple>;
44}

Referenced by TEST_CASE().

Here is the caller graph for this function:

◆ ForwardAll()

template<typename Tuple >
auto Tuple::ForwardAll ( Tuple &&  tuple)

Forwarding of all of a tuple.

Definition at line 130 of file Tuple.h.

130 {
131 constexpr auto Length = std::tuple_size_v<std::decay_t<Tuple>>;
133 std::make_index_sequence<Length>{}, std::forward<Tuple>(tuple));
134}
constexpr auto ForwardingProjection(const std::index_sequence< Indices... > &, Tuple &&tuple)
Destructures a std::index_sequence argument.
Definition: Tuple.h:113

References ForwardingProjection().

Referenced by Registry::detail::ForwardTuple_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ForwardingProjection()

template<size_t... Indices, typename Tuple >
constexpr auto Tuple::ForwardingProjection ( const std::index_sequence< Indices... > &  ,
Tuple &&  tuple 
)
constexpr

Destructures a std::index_sequence argument.

Definition at line 113 of file Tuple.h.

115{
116 return ForwardProject<Indices...>(std::forward<Tuple>(tuple));
117}
constexpr auto ForwardProject
Forwarding of a subsequence of a tuple.
Definition: Tuple.h:98

References ForwardProject.

Referenced by ForwardAll(), and ForwardNext().

Here is the caller graph for this function:

◆ ForwardNext()

template<typename Tuple , typename Decayed = std::decay_t<Tuple>, auto Length = std::tuple_size_v<Decayed>, typename sfinae = std::enable_if_t<(Length > 0)>>
auto Tuple::ForwardNext ( Tuple &&  tuple)

Forwarding of the tail of a tuple.

Definition at line 161 of file Tuple.h.

161 {
163 detail::increment_each<std::make_index_sequence<Length - 1>>{},
164 std::forward<Tuple>(tuple));
165}

References ForwardingProjection().

Referenced by TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::Transparent::type::operator()(), and TypeSwitch::detail::Executor< R, ArgumentTypes, Funs, Args >::Combine< Fs, Wrapped >::CombineOp< BaseClass, NextBase >::Wrapper::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Next()

template<typename Tuple , typename Decayed = std::decay_t<Tuple>, auto Length = std::tuple_size_v<Decayed>, typename sfinae = std::enable_if_t<(Length > 0)>>
auto Tuple::Next ( Tuple &&  tuple)

Projection of the tail of a tuple.

Definition at line 146 of file Tuple.h.

146 {
147 return Projection(
148 detail::increment_each<std::make_index_sequence<Length - 1>>{},
149 std::forward<Tuple>(tuple));
150}

References Projection().

Here is the call graph for this function:

◆ Projection()

template<size_t... Indices, typename Tuple >
auto Tuple::Projection ( const std::index_sequence< Indices... > &  ,
Tuple &&  tuple 
)

Destructures a std::index_sequence argument.

Definition at line 91 of file Tuple.h.

93{
94 return Project<Indices...>(std::forward<Tuple>(tuple));
95}
constexpr auto Project
Return a tuple of values initialized from a subsequence of a tuple.
Definition: Tuple.h:77

References Project.

Referenced by All(), and Next().

Here is the caller graph for this function:

Variable Documentation

◆ Empty_v

template<typename Tuple >
constexpr bool Tuple::Empty_v
constexpr
Initial value:
=
(0 == size_t(std::tuple_size_v<Tuple>))

Definition at line 38 of file Tuple.h.

◆ ForwardProject

template<size_t... Indices>
constexpr auto Tuple::ForwardProject
constexpr
Initial value:
= [](auto &&tuple)
{
using Tuple = decltype(tuple);
constexpr auto size = std::tuple_size_v<std::remove_reference_t<Tuple>>;
static_assert(((Indices < size) && ...), "Indices must be in range");
static_assert(detail::increasing<Indices...>::value,
"Indices must be strictly increasing");
return
std::forward_as_tuple(std::get<Indices>(std::forward<Tuple>(tuple))...);
}
Definition: Tuple.h:20

Forwarding of a subsequence of a tuple.

Definition at line 98 of file Tuple.h.

Referenced by ForwardingProjection().

◆ is_tuple_like_v

template<typename T >
constexpr auto Tuple::is_tuple_like_v
staticconstexpr
Initial value:
=
Type test metapredicate, for more general tuple-like types.
Definition: Tuple.h:28

Definition at line 35 of file Tuple.h.

◆ is_tuple_v

template<typename T >
constexpr auto Tuple::is_tuple_v = is_tuple<T>::value
staticconstexpr

Definition at line 25 of file Tuple.h.

◆ Project

template<size_t... Indices>
constexpr auto Tuple::Project
constexpr
Initial value:
= [](auto &&tuple)
{
using Tuple = decltype(tuple);
constexpr auto size = std::tuple_size_v<std::remove_reference_t<Tuple>>;
static_assert(((Indices < size) && ...), "Indices must be in range");
static_assert(detail::increasing<Indices...>::value,
"Indices must be strictly increasing");
return std::make_tuple(std::get<Indices>(std::forward<Tuple>(tuple))...);
}

Return a tuple of values initialized from a subsequence of a tuple.

Definition at line 77 of file Tuple.h.

Referenced by Projection().