An efficient Tuple class with Set, Get, and an Apply function to pass the tuple contents on to any function. More...
#include <Tuple.h>
Public Member Functions | |
Tuple () | |
Default constructor, elements use default constructors. | |
template<int ResolveAmbiguity = 0> | |
Tuple (const typename std::add_lvalue_reference< typename std::remove_reference< Types >::type >::type... types) | |
Construct by const reference. | |
template<bool ResolveAmbiguity = 0> | |
Tuple (typename std::add_rvalue_reference< typename std::remove_reference< Types >::type >::type... types) | |
Construct by moving elements in. | |
std::tuple< Types... > | GetStdTuple () |
Returns a std::tuple of the same contents. | |
template<size_t N> | |
auto | Get () -> decltype(this->GetHelper< N >(*this)) |
Return element N in the Tuple. | |
template<size_t N> | |
auto | Get () const -> decltype(this->GetHelper< N >(*this)) |
Return element N in the Tuple. | |
template<size_t N, class Val > | |
void | Set (Val val) |
Set element N in the Tuple. | |
template<class Func > | |
auto | Apply (Func f) -> decltype(this->ApplyHelper(f,(typename SequenceGenerator< sizeof...(Types)>::Sequence()))) |
Call function f with each element of the Tuple as an argument. More... | |
template<class T > | |
Data1D< T > | AsData () const |
Return a Data1D array with each element constructed as type T. | |
void | Get (Types &... types) |
Get all elements at once, by reference. | |
template<class... OtherTypes> | |
Tuple< Types..., OtherTypes... > | operator+ (Tuple< OtherTypes... > &other) |
Forms a new Tuple by concatenating two Tuples. | |
An efficient Tuple class with Set, Get, and an Apply function to pass the tuple contents on to any function.
|
inline |
Call function f with each element of the Tuple as an argument.