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

Synopsis

Declared in <bslstl_variant.h>

template<
    class t_HEAD,
    class... t_TAIL>
void
swap(
    bsl::variant<t_HEAD, t_TAIL...>& lhs,
    bsl::variant<t_HEAD, t_TAIL...>& rhs);

Created with MrDocs