Efficiently exchange the value of this object with the value of the specified other object. This method provides the no‐throw exception‐safety guarantee if the template parameter t_TYPE provides that guarantee and the result of the hasValue method for the two objects being swapped is the same. The behavior is undefined unless this object was created with the same allocator as other.
Synopsis
Declared in <bslstl_optional.h>
void
swap(Optional_Base& other) noexcept(/* see-below */);
Exception specification
This function is potentially-throwing unless bsl::is_nothrow_move_constructible<t_TYPE>::value && bsl::is_nothrow_swappable<t_TYPE>::value.
Created with MrDocs