Tuple¶
-
class
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.
-
Tuple
(VariantRef v1)¶
-
Tuple
(VariantRef v1, VariantRef v2)¶
-
Tuple
(VariantRef v1, VariantRef v2, VariantRef v3)¶
-
Tuple
(VariantRef v1, VariantRef v2, VariantRef v3, VariantRef v4)¶ Construct tuples from variants.
- Parameters
v1
: First elementv2
: Second elementv3
: Third elementv4
: Fourth element
Public Functions
-
Tuple
(internal::Tuple other)¶ Construct a tuple from an internal struct (infrastructure)
-
internal::Tuple
impl
() const¶ Get access to the inner immutable object (infrastructure).
-
std::size_t
size
() const¶ Get the number of Elements in this tuple.
-
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 “()”.
-
VariantRef
operator[]
(std::size_t index) const¶ Accessor for elements of the tuple.
-
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.