Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tuplet Namespace Reference

Namespaces

namespace  detail
 
namespace  literals
 
namespace  sfinae
 

Classes

struct  convert
 
struct  pair
 
struct  tuple
 
struct  tuple<>
 
struct  tuple_elem
 
struct  type_list
 Represents a list of types. More...
 
struct  type_map
 
struct  unwrap_ref_decay
 
struct  unwrap_reference
 
struct  unwrap_reference< std::reference_wrapper< U > >
 

Typedefs

template<class T >
using unwrap_ref_decay_t = typename unwrap_ref_decay< T >::type
 
template<class T >
using identity_t = T
 
template<class Tup , class B >
using forward_as_t = typename ::tuplet::detail::_forward_as< Tup, B >::type
 
template<class First , class... >
using first_t = First
 
template<class T >
using type_t = typename T::type
 
template<size_t I>
using tag = std::integral_constant< size_t, I >
 
template<size_t N>
using tag_range = std::make_index_sequence< N >
 
template<class Tup >
using base_list_t = typename std::decay_t< Tup >::base_list
 
template<class Tup >
using element_list_t = typename std::decay_t< Tup >::element_list
 
template<class... T>
using tuple_base_t = typename detail::_get_tuple_base< tag_range< sizeof...(T)>, T... >::type
 

Functions

template<class... Ls, class... Rs>
TUPLET_INLINE constexpr auto operator+ (type_list< Ls... >, type_list< Rs... >)
 Convinience + operator for catenating type lists.
 
template<class... Ts>
 tuple (Ts...) -> tuple< unwrap_ref_decay_t< Ts >... >
 
template<class A , class B >
 pair (A, B) -> pair< unwrap_ref_decay_t< A >, unwrap_ref_decay_t< B > >
 
template<class Tuple >
 convert (Tuple &) -> convert< Tuple & >
 
template<class Tuple >
 convert (Tuple const &) -> convert< Tuple const & >
 
template<class Tuple >
 convert (Tuple &&) -> convert< Tuple >
 
template<size_t I, TUPLET_WEAK_CONCEPT(indexable) Tup>
TUPLET_INLINE constexpr decltype(auto) get (Tup &&tup)
 
template<class... T>
TUPLET_INLINE constexpr tuple< T &... > tie (T &... t)
 
template<class F , TUPLET_WEAK_CONCEPT(base_list_tuple) Tup>
TUPLET_INLINE constexpr decltype(autoapply (F &&func, Tup &&tup)
 
template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(autoapply (F &&func, tuplet::pair< A, B > &pair)
 
template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(autoapply (F &&func, tuplet::pair< A, B > const &pair)
 
template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(autoapply (F &&func, tuplet::pair< A, B > &&pair)
 
template<class... T>
TUPLET_INLINE void swap (tuple< T... > &a, tuple< T... > &b) noexcept(tuple< T... >::nothrow_swappable)
 
template<class A , class B >
TUPLET_INLINE void swap (pair< A, B > &a, pair< A, B > &b) noexcept(pair< A, B >::nothrow_swappable)
 
template<typename... Ts>
TUPLET_INLINE constexpr auto make_tuple (Ts &&... args)
 
template<typename... T>
TUPLET_INLINE constexpr auto forward_as_tuple (T &&... a) noexcept
 
template<TUPLET_WEAK_CONCEPT(base_list_tuple)... T>
constexpr auto tuple_cat (T &&... ts)
 

Variables

template<size_t I>
constexpr tag< Itag_v {}
 
template<class T >
constexpr bool stateless_v = std::is_empty_v<std::decay_t<T>>
 
template<class Tuple >
constexpr auto base_list_tuple_v
 

Typedef Documentation

◆ base_list_t

Definition at line 264 of file tuplet.hpp.

◆ element_list_t

Definition at line 265 of file tuplet.hpp.

◆ first_t

template<class First , class... >
using tuplet::first_t = typedef First

Definition at line 253 of file tuplet.hpp.

◆ forward_as_t

Takes a type B, and gives it the same "rvalue" status as Tup Used for forwarding values out of a tuple

Definition at line 251 of file tuplet.hpp.

◆ identity_t

Definition at line 247 of file tuplet.hpp.

◆ tag

template<size_t I>
using tuplet::tag = typedef std::integral_constant<size_t, I>

Definition at line 258 of file tuplet.hpp.

◆ tag_range

Definition at line 262 of file tuplet.hpp.

◆ tuple_base_t

template<class... T>
using tuplet::tuple_base_t = typedef typename detail::_get_tuple_base<tag_range<sizeof...(T)>, T...>::type

Obtains a tuplet::type_map whose bases correspond to tuplet::tuple_elem<I, T>. Used as the base class for tuplet::tuple.

Definition at line 548 of file tuplet.hpp.

◆ type_t

template<class T >
using tuplet::type_t = typedef typename T::type

Definition at line 256 of file tuplet.hpp.

◆ unwrap_ref_decay_t

Definition at line 245 of file tuplet.hpp.

Function Documentation

◆ apply() [1/4]

TUPLET_INLINE constexpr decltype(auto) tuplet::apply ( F &&  func,
Tup &&  tup 
)
constexpr

Definition at line 1032 of file tuplet.hpp.

◆ apply() [2/4]

template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(auto) tuplet::apply ( F &&  func,
tuplet::pair< A, B > &&  pair 
)
constexpr

Definition at line 1045 of file tuplet.hpp.

◆ apply() [3/4]

template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(auto) tuplet::apply ( F &&  func,
tuplet::pair< A, B > &  pair 
)
constexpr

Definition at line 1036 of file tuplet.hpp.

◆ apply() [4/4]

template<class F , class A , class B >
TUPLET_INLINE constexpr decltype(auto) tuplet::apply ( F &&  func,
tuplet::pair< A, B > const pair 
)
constexpr

Definition at line 1041 of file tuplet.hpp.

◆ convert() [1/3]

template<class Tuple >
tuplet::convert ( Tuple &&  ) -> convert< Tuple >

◆ convert() [2/3]

template<class Tuple >
tuplet::convert ( Tuple ) -> convert< Tuple & >

◆ convert() [3/3]

template<class Tuple >
tuplet::convert ( Tuple const ) -> convert< Tuple const & >

◆ forward_as_tuple()

template<typename... T>
TUPLET_INLINE constexpr auto tuplet::forward_as_tuple ( T &&...  a)
constexprnoexcept

Definition at line 1067 of file tuplet.hpp.

◆ get()

template<size_t I, TUPLET_WEAK_CONCEPT(indexable) Tup>
TUPLET_INLINE constexpr decltype(auto) tuplet::get ( Tup &&  tup)
constexpr

Definition at line 1021 of file tuplet.hpp.

◆ make_tuple()

template<typename... Ts>
TUPLET_INLINE constexpr auto tuplet::make_tuple ( Ts &&...  args)
constexpr

Definition at line 1062 of file tuplet.hpp.

◆ operator+()

template<class... Ls, class... Rs>
TUPLET_INLINE constexpr auto tuplet::operator+ ( type_list< Ls... >  ,
type_list< Rs... >   
)
constexpr

Convinience + operator for catenating type lists.

Definition at line 117 of file tuplet.hpp.

◆ pair()

template<class A , class B >
tuplet::pair ( A  ,
B   
) -> pair< unwrap_ref_decay_t< A >, unwrap_ref_decay_t< B > >

◆ swap() [1/2]

template<class A , class B >
TUPLET_INLINE void tuplet::swap ( pair< A, B > &  a,
pair< A, B > &  b 
)
noexcept

Definition at line 1057 of file tuplet.hpp.

◆ swap() [2/2]

template<class... T>
TUPLET_INLINE void tuplet::swap ( tuple< T... > &  a,
tuple< T... > &  b 
)
noexcept

Definition at line 1051 of file tuplet.hpp.

◆ tie()

template<class... T>
TUPLET_INLINE constexpr tuple< T &... > tuplet::tie ( T &...  t)
constexpr

Definition at line 1026 of file tuplet.hpp.

◆ tuple()

template<class... Ts>
tuplet::tuple ( Ts...  ) -> tuple< unwrap_ref_decay_t< Ts >... >
private

◆ tuple_cat()

constexpr auto tuplet::tuple_cat ( T &&...  ts)
constexpr

It appears that Clang produces better assembly when TUPLET_CAT_BY_FORWARDING_TUPLE == 0, while GCC produces better assembly when TUPLET_CAT_BY_FORWARDING_TUPLE == 1. MSVC always produces terrible assembly in either case. This will set TUPLET_CAT_BY_FORWARDING_TUPLE to the correct value (0 for clang, 1 for everyone else)

See: https://github.com/codeinred/tuplet/discussions/14

Definition at line 1101 of file tuplet.hpp.

Variable Documentation

◆ base_list_tuple_v

template<class Tuple >
constexpr auto tuplet::base_list_tuple_v
constexpr
Initial value:
=
tuplet::sfinae::detail::_has_base_list<Tuple>(0)

Definition at line 320 of file tuplet.hpp.

◆ stateless_v

template<class T >
constexpr bool tuplet::stateless_v = std::is_empty_v<std::decay_t<T>>
constexpr

Definition at line 267 of file tuplet.hpp.

◆ tag_v

template<size_t I>
constexpr tag<I> tuplet::tag_v {}
constexpr

Definition at line 260 of file tuplet.hpp.