System::Tuple class

Tuple class

Class that represents a tuple data structure. Maximum number of items is 8.

template<typename ...>class Tuple : public System::Runtime::CompilerServices::ITuple
ParameterDescription
ArgsThe tuple elements types.

Methods

MethodDescription
Equals(SharedPtr<Object>) overrideDetermines if the current and the specified objects are identical.
get_Item() constGets the value of the Tuple object’s component.
Tuple(Args…)Constructs a tuple object.

Remarks

#include "system/smart_ptr.h"
#include "system/tuple.h"
#include <iostream>

int main()
{
  const auto tuple = System::MakeObject<System::Tuple<int, int, int>>(32, 16, 128);

  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: 32
Item 2: 16
Item 3: 128
*/

See Also