BloombergLP::bdlb::VariantImp

This class provides the implementation of Variant (except for the creators) given a list of template parameter TYPES.

Synopsis

Declared in <bdlb_variant.h>

template<class TYPES>
class VariantImp
    : public VariantImp_Traits<TYPES>::BaseType

Description

More generally, if each of the types in the list of TYPES is value semantic, then this class also supports a complete set of value semantic operations, including copy construction, assignment, equality comparison, and ostream printing. A precise operational definition of when two instances have the same value can be found in the description of operator== for the class. This class is exception neutral with no guarantee of rollback: if an exception is thrown during the invocation of a method on a pre-existing instance, the object is left in a valid state, but its value is undefined. In no event is memory leaked. Finally, aliasing (e.g., using all or part of an object as both source and destination) is supported in all cases.

If any of the types in the list of TYPES does not support operator==, or any of the value-semantic operations mentioned above, then this variant also does not support that operation and attempts to invoke it will trigger a compilation diagnostic.

Base Classes

NameDescription
VariantImp_Traits<TYPES>::BaseType

Member Functions

NameDescription
VariantImp [constructor]Create a variant object in the unset state that uses the currently installed default allocator to supply memory.
VariantImp [constructor]Create a variant object having the type and value of the specified original object by moving the contents of original to the newly-created object. The allocator associated with original (if any) is propagated for use in the newly-created object. original is left in a valid but unspecified state.
VariantImp [constructor]Create a variant object with the specified valueOrAllocator that can be either a value of a type that the variant can hold or an allocator to supply memory. If valueOrAllocator is not a bslma::Allocator *, then the variant will hold the value and type of valueOrAllocator, and use the currently installed default allocator to supply memory. Otherwise, the variant will be unset and use valueOrAllocator to supply memory. TYPE_OR_ALLOCATOR must be the same as one of the types that this variant can hold or be convertible to bslma::Allocator *. Note that this parameterized constructor is defined instead of two constructors (one taking a bslma::Allocator * and the other not) because template parameter arguments are always a better match than derived-to-base conversion (a concrete allocator pointer converted to bslma::Allocator *).
VariantImp [constructor]Create a variant object having the type and value of the specified original object that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The contents of original are moved to the newly-created object with original left in a valid but unspecified state.
VariantImp [constructor]Create a variant object having the type and value of the specified original variant. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.
VariantImp [constructor]Create a variant object having the specified value of template parameter TYPE and that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used. TYPE must be the same as one of the types that this variant can hold.
VariantImp [constructor]Create a variant object having the specified value of template parameter TYPE by moving the contents of value to the newly-created object. Use the currently installed default allocator to supply memory. value is left in a valid but unspecified state. TYPE must be the same as one of the types that this variant can hold. Note that in C++11 mode, this method does not participate in overload resolution if it would lead to ambiguity with the move constructor that does not take an allocator (below) or with the constructor taking a valueOrAllocator (above).
VariantImp [constructor]Create a variant object having the specified value of template parameter TYPE that uses the specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used. The contents of value are moved to the newly-created object with value left in a valid but unspecified state. TYPE must be the same as one of the types that this variant can hold. Note that in C++11 mode, this method does not participate in overload resolution if it would lead to ambiguity with the move constructor that takes an allocator (below).
~VariantImp [destructor]Destroy this variant object, invoking the destructor of the type of object contained (if any) on the value of that type.
operator= Assign to this object the type and value currently held by the specified rhs object, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the rhs object.
operator= Assign to this object the type and value currently held by the specified rhs object, and return a reference providing modifiable access to this object. The contents of rhs are either move-inserted into or move-assigned to this object with rhs left in a valid but unspecified state.
operator= Assign to this object the specified value of template parameter TYPE, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold.
operator= Assign to this object the specified value of template parameter TYPE, and return a reference providing modifiable access to this object. The contents of value are moved to this object with value left in a valid but unspecified state. The value currently held by this variant (if any) is destroyed if that value`s type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold. Note that in C++11 mode, this method does not participate in overload resolution if it would lead to ambiguity with the move-assignment operator (below).
apply Apply the specified visitor to this modifiable variant by passing the value this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value returned by the 'visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor.
apply Same as the preceding overload, but for a const visitor.
apply Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, a default constructed bslmf::Nil is passed to the visitor.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
apply Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE.
apply Same as the preceding overload, but for a const visitor.
apply Apply the specified visitor to this variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. If this variant is unset, the specified defaultValue of template parameter TYPE is passed to the visitor. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless this variant is unset or holds a value of template parameter TYPE.
applyRaw Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this modifiable variant by passing the value (of template parameter TYPE) this variant currently holds to the visitor object's operator(). This method does not return a value. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value returned by the visitor. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR defines a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(). This method does not return a value. The behavior is undefined if this variant is unset. Note that this method is selected only if the template parameter type VISITOR does not define a typedef of ResultType in its public interface. Also note that this method is defined inline to work around a Windows compiler bug with SFINAE functions.
applyRaw Apply the specified visitor to this modifiable variant by passing the value this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. The behavior is undefined if this variant is unset.
applyRaw Apply the specified visitor to this variant by passing the value this variant currently holds to the visitor object's operator(), and return the value (of template parameter RET_TYPE) returned by the visitor. The behavior is undefined if this variant is unset.
applyRaw Same as the preceding overload, but for a const visitor.
applyRaw Same as the preceding overload, but for a const visitor.
assign Assign to this object the specified value of template parameter TYPE, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold.
assign Assign to this object the specified value of template parameter TYPE, and return a reference providing modifiable access to this object. The contents of value are moved to this object with value left in a valid but unspecified state. The value currently held by this variant (if any) is destroyed if that value`s type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold.
assignTo Assign to this object the specified value of template parameter SOURCE_TYPE converted to template parameter TYPE, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as TYPE. TYPE must be the same as one of the types that this variant can hold and SOURCE_TYPE must be convertible to TYPE.
bdexStreamIn DEPRECATED: Do not use.
bdexStreamOut DEPRECATED: Do not use.
createInPlace Create an instance of template parameter TYPE in this variant object with up to 14 parameters using the allocator currently held by this variant to supply memory, and return a reference providing modifiable access to the created instance. This method first destroys the current value held by this variant (even if TYPE is the same as the type currently held). TYPE must be the same as one of the types that this variant can hold. Note the order of the template arguments was chosen so that TYPE must always be specified.
is Return true if the value held by this variant object is of template parameter TYPE, and false otherwise. TYPE must be the same as one of the types that this variant can hold. Note that TYPE must be specified explicitly, e.g., myValue.is<int>().
isUnset Return true if this variant is currently unset, and false otherwise. An unset variant does not hold a value or type. Note that this method should be preferred over checking the type index of the variant.
maxSupportedBdexVersion DEPRECATED: Do not use.
print Format this object to the specified output stream at the (absolute value of) the optionally specified indentation level, and return a reference to stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, format the entire output on one line, suppressing all but the initial indentation (as governed by level). If stream is not valid on entry, this operation has no effect. Nothing is printed if this variant is unset. Each type that may be contained by this variant shall be printable with bdlb::PrintMethods (typically meaning that they either declare the bdlb::HasPrintMethod trait or provide the << output streaming operator). See {bdlb_printmethods}. The compiler will emit an error if bdlb::PrintMethods::print cannot be instantiated for each type that may be contained by this variant.
reset Destroy the current value held by this variant (if any), and reset this variant to the unset state.
swap Swap the value of this object with the value of the specified other object. This method provides the no-throw guarantee if the TYPE template parameter has a no-throw swap and the two variant objects being swapped have the same type; otherwise this method provides the basic guarantee.
the Return a reference providing modifiable access to the value of template parameter TYPE held by this variant object. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless is<TYPE>() returns true and TYPE is not void. Note that TYPE must be specified explicitly, e.g., myValue.the<int>().
the Return a reference providing non-modifiable access to the value of template parameter TYPE held by this variant object. TYPE must be the same as one of the types that this variant can hold. The behavior is undefined unless is<TYPE>() returns true and TYPE is not void. Note that TYPE must be specified explicitly, e.g., myValue.the<int>().
typeIndex Return the index in the list of TYPES corresponding to the type of the value currently held by this variant object (starting at 1), or 0 if this object is unset. Note that instead of switching code on the type index, calling apply is the preferred method of manipulating different types stored inside a variant.
typeInfo Return typeid(void).
operator BloombergLP::bslmf::NestedTraitDeclaration<VariantImp, HasPrintMethod> Nested trait declaration for bdlb::HasPrintMethod.
operator BloombergLP::bslmf::NestedTraitDeclaration<VariantImp, IsBitwiseCopyable, Traits::k_VARIANT_IS_BITWISE_COPYABLE> Nested trait declaration for bslmf::IsBitwiseCopyable.
operator BloombergLP::bslmf::NestedTraitDeclaration<VariantImp, IsBitwiseMoveable, Traits::k_VARIANT_IS_BITWISE_MOVEABLE> Nested trait declaration for bslmf::IsBitwiseMoveable.
operator BloombergLP::bslmf::NestedTraitDeclaration<VariantImp, UsesBslmaAllocator, Traits::k_VARIANT_USES_BSLMA_ALLOCATOR> Nested trait declaration for bslma::UsesBslmaAllocator.

Non-Member Functions

NameDescription
operator!=Return true if the specified lhs variant object does not have the same value as the specified rhs variant object, and false otherwise. Two variant objects do not have the same value if one is set and the other is unset, or if they are both set but hold objects that differ in type or value.
operator==Grant the equality comparison operator access to this class's private members.
operator==Return true if the specified lhs variant object has the same value as the specified rhs variant object, and false otherwise. Two variant objects have the same value if they are both set and hold objects of the same type and same value, or are both unset.
swapSwap the values of the specified a and b objects. This method provides the no-throw guarantee if the TYPE template parameter has a no-throw swap and the two variant objects being swapped has the same type; otherwise this method provides the basic guarantee.

Derived Classes

NameDescription
Variant
Variant10 This class is a "specialization" of Variant for a fixed number (10) of types. Its 10 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A10>.
Variant11 This class is a "specialization" of Variant for a fixed number (11) of types. Its 11 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A11>.
Variant12 This class is a "specialization" of Variant for a fixed number (12) of types. Its 12 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A12>.
Variant13 This class is a "specialization" of Variant for a fixed number (13) of types. Its 13 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A13>.
Variant14 This class is a "specialization" of Variant for a fixed number (14) of types. Its 14 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A14>.
Variant15 This class is a "specialization" of Variant for a fixed number (15) of types. Its 15 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A15>.
Variant16 This class is a "specialization" of Variant for a fixed number (16) of types. Its 16 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A16>.
Variant17 This class is a "specialization" of Variant for a fixed number (17) of types. Its 17 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A17>.
Variant18 This class is a "specialization" of Variant for a fixed number (18) of types. Its 18 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A18>.
Variant19 This class is a "specialization" of Variant for a fixed number (19) of types. Its 19 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A19>.
Variant2 This class is a "specialization" of Variant for a fixed number (2) of types. Its 2 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2>.
Variant3 This class is a "specialization" of Variant for a fixed number (3) of types. Its 3 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, A3>.
Variant4 This class is a "specialization" of Variant for a fixed number (4) of types. Its 4 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A4>.
Variant5 This class is a "specialization" of Variant for a fixed number (5) of types. Its 5 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A5>.
Variant6 This class is a "specialization" of Variant for a fixed number (6) of types. Its 6 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A6>.
Variant7 This class is a "specialization" of Variant for a fixed number (7) of types. Its 7 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A7>.
Variant8 This class is a "specialization" of Variant for a fixed number (8) of types. Its 8 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A8>.
Variant9 This class is a "specialization" of Variant for a fixed number (9) of types. Its 9 template arguments must all be specified (none are defaulted to bslmf::Nil). It provides the same functionality as Variant<A1, A2, ..., A9>.