Tuple#

class Tuple#

Represents a tuple.

Constructors

Constructors for Tuple objects.

inline Tuple()#

Construct an empty Tuple.

inline AMPL_TUPLE *impl() const#

Get access to the inner immutable object (infrastructure).

inline Tuple(Variant arguments[], std::size_t N)#

Construct a n-Tuple from an array of variants.

inline Tuple(const Tuple &other)#

Copy constructor.

If OWNING copy the resources

inline ~Tuple()#

Destructor.

inline Tuple &operator=(const Tuple &other)#

Assignment operator.

Constructors from variants

Constructors from ampl::Variant objects.

inline Tuple(Variant v1)#
inline Tuple(Variant v1, Variant v2)#
inline Tuple(Variant v1, Variant v2, Variant v3)#
inline Tuple(Variant v1, Variant v2, Variant v3, Variant v4)#

Construct tuples from variants.

Parameters:
  • v1 – First element

  • v2 – Second element

  • v3 – Third element

  • v4 – Fourth element

Public Functions

inline explicit Tuple(AMPL_TUPLE *other)#

Construct a tuple from an internal struct (infrastructure).

inline std::size_t size() const#

Get the number of Elements in this tuple.

inline std::string toString() const#

Return a string representation of this tuple.

All elements are formatted as in BasicVariant::toString and comma separated. An empty tuple is returned as “()”.

inline Variant operator[](std::size_t index) const#

Accessor for elements of the tuple.

Public Static Functions

static inline Tuple join(Tuple t1, Tuple t2)#

Join two tuples together and forms a new one copying all data.