Tuple¶
-
class ampl::Tuple : public ampl::BasicTuple<true>¶
Represents a tuple with ownership semantics (owns all the data it contains)
Constructors
Constructors for Tuple objects.
Constructors from variants
Constructors from ampl::Variant objects.
-
inline explicit Tuple(VariantRef v1)¶
-
inline Tuple(VariantRef v1, VariantRef v2)¶
-
inline Tuple(VariantRef v1, VariantRef v2, VariantRef v3)¶
-
inline Tuple(VariantRef v1, VariantRef v2, VariantRef v3, VariantRef v4)¶
Construct tuples from variants.
- Parameters
v1 – First element
v2 – Second element
v3 – Third element
v4 – Fourth element
Public Functions
-
inline explicit Tuple(internal::Tuple other)¶
Construct a tuple from an internal struct (infrastructure)
-
inline internal::Tuple impl() const¶
Get access to the inner immutable object (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 VariantRef operator[](std::size_t index) const¶
Accessor for elements of the tuple.
-
inline explicit Tuple(VariantRef v1)¶
TupleRef¶
-
typedef BasicTuple<false> ampl::TupleRef¶
Not owning Tuple.
A public typedef of BasicTuple without ownership semantics. It can be used both as a return type when the ownership semantics is not needed (e.g. returning a reference to a tuple stored in a container) and as an argument type to provide implicit conversions and reduce the number of required overloads.