Name |
Description |
get
|
See the first get overload above. |
get
|
See the first get overload above. |
get
|
See the first get overload above. |
get
|
Return a reference to the alternative object at index (template parameter) t_INDEX in the specified obj. If t_INDEX is not the index of the currently active alternative, throw an exception of type bad_variant_access. t_INDEX shall be a valid index for the variant type of obj. |
get
|
See the first get overload above. |
get
|
See the first get overload above. |
get
|
Return a reference to the alternative object with type (template parameter) t_TYPE in the specified obj. If t_TYPE is not the type of the currently active alternative, throw an exception of type bad_variant_access. t_TYPE shall appear exactly once in the variant's list of alternatives. |
get
|
See the first get overload above. |
get_if
|
Return a pointer to the alternative object with type (template parameter) t_TYPE in the specified obj, or a null pointer if obj itself is a null pointer or if t_TYPE is not the type of the currently active alternative. t_TYPE shall appear exactly once in the variant's list of alternatives. |
get_if
|
Return a pointer to the alternative object with type (template parameter) t_TYPE in the specified obj, or a null pointer if obj itself is a null pointer or if t_TYPE is not the type of the currently active alternative. t_TYPE shall appear exactly once in the variant's list of alternatives. |
get_if
|
Return a pointer to the alternative at index t_INDEX, or null. |
get_if
|
Return a pointer to the alternative object with index (template parameter) t_INDEX in the specified obj, or a null pointer if obj itself is a null pointer or if t_INDEX is not the index of the currently active alternative. t_INDEX shall be a valid alternative index. |
holds_alternative
|
Return true if the specified obj currently holds the (template parameter) t_TYPE alternative, and false otherwise. t_TYPE shall appear exactly once in the variant's list of alternatives. |
operator!=
|
Return true if the specified lhs and rhs have different active alternatives or only one holds an alternative, or if they have the same active alternative and the contained values compare unequal; otherwise, return false. All alternatives shall support operator!=. |
operator<
|
Return true if the index of the active alternative in the specified lhs is less than that of the specified rhs, or if both have the same active alternative and the contained value of lhs compares less than that of rhs, or if lhs is valueless by exception and rhs is not; otherwise, return false. All alternatives shall support operator<. |
operator<=
|
Return true if the index of the active alternative in the specified lhs is less than that of the specified rhs, or if both have the same active alternative and the contained value of lhs compares less than or equal to that of rhs, or if lhs is valueless by exception; otherwise, return false. All alternatives shall support operator<=. |
operator<=>
|
If lhs and rhs are not valueless by exception and hold the same alternative i, return get(lhs) <=> get(rhs) . If lhs and rhs are not valueless by exception and hold the aalternatives i and j respectively, return i<=>j. Return strong_ordering::equal if both variants are valueless by exception. Return strong_ordering::less if lhs is valueless by exception. Return strong_ordering::greater if rhs is valueless by exception. |
operator==
|
Return true if the specified lhs and rhs are both valueless by exception or if they have the same active alternative and their contained values compare equal; otherwise, return false. All alternatives shall support operator==. |
operator>
|
Return true if the index of the active alternative in the specified lhs is greater than that of the specified rhs, or if both have the same active alternative and the contained value of lhs compares greater than that of rhs, or if rhs is valueless by exception and lhs is not; otherwise, return false. All alternatives shall support operator>. |
operator>=
|
Return true if the index of the active alternative in the specified lhs is greater than that of the specified rhs, or if both have the same active alternative and the contained value of lhs compares greater than or equal to that of rhs, or if rhs is valueless by exception; otherwise, return false. All alternatives shall support operator>=. |
swap
|
Efficiently exchange the values of the specified lhs and rhs objects. This method provides the no‐throw guarantee if the two variant objects being swapped have the same active alternative and that alternative provides that guarantee; otherwise, this method provides the basic guarantee. If lhs and rhs do not contain the same alternative or they have unequal allocators, and an exception is thrown during the swap, either or both variant objects may be left in a valueless state or with an alternative in a moved‐from state. All alternatives shall be move constructible and swappable. For simplicity of implementation, this function differs from the standard in the following : * constraints are not implemented * constexpr is not implemented |