Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
mundy::tuple< Elements > Struct Template Reference

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

#include <tuple.hpp>

Inheritance diagram for mundy::tuple< Elements >:
[legend]

Public Types

template<size_t N>
using element_t = type_at_index_t<N, Elements...>
 Get the type of the N'th element.

Public Member Functions

constexpr tuple ()=default
 Default constructor. Only valid if all elements are default constructible.
constexpr tuple (Elements... vals)
 Constructor that takes a set of values; each is moved into its element if movable, else copied.
constexpr tuple (const tuple &)=default
 Default copy/move/assign constructors.
constexpr tuple (tuple &&)=default
constexpr tupleoperator= (const tuple &)=default
constexpr tupleoperator= (tuple &&)=default

Static Public Member Functions

static constexpr size_t size ()
 Get the size of the tuple.

Member Typedef Documentation

◆ element_t

template<class... Elements>
template<size_t N>
using mundy::tuple< Elements >::element_t = type_at_index_t<N, Elements...>

Constructor & Destructor Documentation

◆ tuple() [1/4]

template<class... Elements>
mundy::tuple< Elements >::tuple ( )
constexprdefault

◆ tuple() [2/4]

template<class... Elements>
mundy::tuple< Elements >::tuple ( Elements... vals)
inlineconstexpr

◆ tuple() [3/4]

template<class... Elements>
mundy::tuple< Elements >::tuple ( const tuple< Elements > & )
constexprdefault

◆ tuple() [4/4]

template<class... Elements>
mundy::tuple< Elements >::tuple ( tuple< Elements > && )
constexprdefault

Member Function Documentation

◆ operator=() [1/2]

template<class... Elements>
tuple & mundy::tuple< Elements >::operator= ( const tuple< Elements > & )
constexprdefault

◆ operator=() [2/2]

template<class... Elements>
tuple & mundy::tuple< Elements >::operator= ( tuple< Elements > && )
constexprdefault

◆ size()

template<class... Elements>
constexpr size_t mundy::tuple< Elements >::size ( )
inlinestaticconstexpr