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
Name |
Description |
|
Member Functions
Name |
Description |
|
Create a variant object in the unset state that uses the currently installed default allocator to supply memory. |
|
Create a variant by moving from |
|
Create a variant from |
|
Create a variant by moving from the specified |
|
Create a variant holding |
|
Create a variant by moving from |
|
Create a variant with the type and value of |
|
Create a variant holding |
|
Destroy this variant object, invoking the destructor of the type of object contained (if any) on the value of that type. |
Assign the type and value of |
|
Assign the type and value of |
|
Assign the specified |
|
Assign the specified |
|
Apply |
|
Apply the specified |
|
Apply |
|
Apply |
|
Apply |
|
Apply the specified |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Same as the preceding overload, but for a |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Same as the preceding overload, but for a |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply |
|
Apply a const |
|
Same as the preceding overload, but for a |
|
Assign the specified |
|
Assign the specified |
|
Assign |
|
DEPRECATED: Do not use. |
|
DEPRECATED: Do not use. |
|
Emplace a |
|
Return whether this variant currently holds a |
|
Return whether this variant currently holds no value. |
|
DEPRECATED: Do not use. |
|
Format this object to the specified output |
|
Destroy the current value held by this variant (if any), and reset this variant to the unset state. |
|
Swap the value of this object with |
|
Return a modifiable reference to the held |
|
Return a non‐modifiable reference to the held |
|
Return the 1‐based index of the held type, or 0 if unset. |
|
Return |
|
|
Nested trait declaration for |
Nested trait declaration for |
|
Nested trait declaration for |
|
Nested trait declaration for |
Non-Member Functions
Name |
Description |
Return whether |
|
Grant the equality comparison operator access to this class's private members. |
|
Return whether |
|
Swap the values of the specified |
Derived Classes
Name |
Description |
Discriminated union that holds a value of one of up to 20 alternative types. |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
|
Fixed‐arity specialization of |
Created with MrDocs