bsl::vector<unsigned char>::swap

Exchange the value of this object with that of the specified other object; also exchange the allocator of this object with that of other if the (template parameter) type ALLOCATOR has the propagate_on_container_swap trait, and do not modify either allocator otherwise. This method provides the no-throw exception-safety guarantee. This operation has O[1] complexity if either this object was created with the same allocator as other or ALLOCATOR has the propagate_on_container_swap trait; otherwise, it has O[n + m] complexity, where n and m are the number of elements in this object and other, respectively. Note that this method`s support for swapping objects created with different allocators when ALLOCATOR does not have the propagate_on_container_swap trait is a departure from the C++ Standard.

Synopsis

Declared in <bslstl_vector.h>

void
swap(vector<unsigned char>& other) noexcept(/* see-below */);

Exception specification

This function is potentially-throwing unless AllocatorTraits::propagate_on_container_swap::value || AllocatorTraits::is_always_equal::value.