Asposecpplib
System::TupleFactory Class Reference

Provides static methods for creating tuple objects. More...

Static Public Member Functions

template<typename ... Args>
static SharedPtr< Tuple< Args... > > Create (Args... args)
 Creates a new tuple object. More...
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename TRest >
static SharedPtr< Tuple< T1, T2, T3, T4, T5, T6, T7, SharedPtr< Tuple< TRest > > > > Create (T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest)
 Creates a new 8-tuple. The 8th element is stored inside Tuple. More...
 

Detailed Description

Provides static methods for creating tuple objects.

#include "system/smart_ptr.h"
#include "system/tuple.h"
#include <iostream>
int main()
{
const auto tuple = System::TupleFactory::Create(256, 16, 64);
std::cout <<
"Item 1: " << tuple->get_Item<0>() << std::endl <<
"Item 2: " << tuple->get_Item<1>() << std::endl <<
"Item 3: " << tuple->get_Item<2>() << std::endl;
return 0;
}
/*
This code example produces the following output:
Item 1: 256
Item 2: 16
Item 3: 64
*/
static SharedPtr< Tuple< Args... > > Create(Args... args)
Creates a new tuple object.
Definition: tuple.h:254

Member Function Documentation

◆ Create() [1/2]

template<typename ... Args>
static SharedPtr<Tuple<Args...> > System::TupleFactory::Create ( Args...  args)
inlinestatic

Creates a new tuple object.

◆ Create() [2/2]

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename TRest >
static SharedPtr<Tuple<T1, T2, T3, T4, T5, T6, T7, SharedPtr<Tuple<TRest> > > > System::TupleFactory::Create ( T1  item1,
T2  item2,
T3  item3,
T4  item4,
T5  item5,
T6  item6,
T7  item7,
TRest  rest 
)
inlinestatic

Creates a new 8-tuple. The 8th element is stored inside Tuple.