Constructors
Declared in <bdlb_variant.h>
Create a variant object in the unset state that uses the currently installed default allocator to supply memory.
Variant16();
» more...
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.
Variant16(bslmf::MovableRef<Variant16> original);
» more...
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 *).
template<class TYPE_OR_ALLOCATOR>
explicit
Variant16(TYPE_OR_ALLOCATOR const& valueOrAllocator);
» more...
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.
Variant16(
bslmf::MovableRef<Variant16> original,
bslma::Allocator* basicAllocator);
» more...
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.
Variant16(
Variant16 const& original,
bslma::Allocator* basicAllocator = 0);
» more...
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.
template<class TYPE>
Variant16(
TYPE const& value,
bslma::Allocator* basicAllocator);
» more...
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).
template<class TYPE>
explicit
Variant16(
TYPE&& value,
void* = 0)
requires !bsl::is_same<
SelfType,
typename bsl::remove_const<
typename bsl::remove_reference<TYPE>::type>::type>::value
&&
!bsl::is_convertible<TYPE, bslma::Allocator *>::value;
» more...
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).
template<class TYPE>
Variant16(
TYPE&& value,
bslma::Allocator* basicAllocator)
requires !bsl::is_same<
SelfType,
typename bsl::remove_const<
typename bsl::remove_reference<TYPE>::type>::type>::value;
» more...