Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
tuple.hpp File Reference

Classes

struct  mundy::tuple< Elements >
 A simple std::tuple-like class that can be used in device code with similar semantics to std::tuple (e.g., get<N>(), get<T>(), tuple_cat, etc.). Constructing a tuple from a set of values moves each one that supports moving and copies the rest; the tuple itself is copyable, movable, and default constructible if all of its elements are (respectively). More...
struct  mundy::tuple_size< tuple< Es... > >
struct  mundy::tuple_element< I, tuple< Es... > >

Namespaces

namespace  mundy

Typedefs

template<size_t I, class T>
using mundy::tuple_element_t = typename tuple_element<I, T>::type
template<typename... input_t>
using mundy::tuple_cat_t = decltype(tuple_cat(std::declval<input_t>()...))
 The type of the concatenation of two tuples.

Functions

template<size_t Idx, class... Args>
constexpr auto & mundy::get (tuple< Args... > &vals)
 Get the I'th element of a tuple.
template<size_t Idx, class... Args>
constexpr const auto & mundy::get (const tuple< Args... > &vals)
template<size_t Idx, class... Args>
constexpr auto && mundy::get (tuple< Args... > &&vals)
template<class T, class... Args>
constexpr auto & mundy::get (tuple< Args... > &vals)
 Get the element of a tuple with the given type T (errors if T is not unique).
template<class T, class... Args>
constexpr const auto & mundy::get (const tuple< Args... > &vals)
template<class FirstTuple, class SecondTuple>
constexpr auto mundy::tuple_cat (FirstTuple &&first, SecondTuple &&second)
 Concatenate two tuples into a single tuple containing all elements of both, copying or moving each element depending on whether its source tuple is passed as an lvalue or rvalue.
template<class... Elements>
constexpr auto mundy::make_tuple (Elements... vals)
 Make a tuple from a list of values.
template<class F, class... Elements>
constexpr void mundy::for_each (tuple< Elements... > &t, F &&f)
 Call f(element) for every element of the tuple, in order.
template<class F, class... Elements>
constexpr void mundy::for_each (const tuple< Elements... > &t, F &&f)
template<class Pred, class... Elements>
constexpr bool mundy::all_of (const tuple< Elements... > &t, Pred &&pred)
 True if pred(element) holds for every element of the tuple (vacuously true for an empty tuple).
template<class Pred, class... Elements>
constexpr bool mundy::any_of (const tuple< Elements... > &t, Pred &&pred)
 True if pred(element) holds for at least one element of the tuple (vacuously false for an empty tuple).
template<class F, class... Elements>
constexpr decltype(auto) mundy::apply (F &&f, tuple< Elements... > &t)
 Invoke f with the tuple's elements as positional arguments: f(get<0>(t), get<1>(t), ...).
template<class F, class... Elements>
constexpr decltype(auto) mundy::apply (F &&f, const tuple< Elements... > &t)

Variables

template<class T>
static constexpr size_t mundy::tuple_size_v = tuple_size<T>::value