[#bsl-deque-0c-swap] = xref:bsl.adoc[bsl]::xref:bsl/deque-0c.adoc[deque]::swap :relfileprefix: ../../ :mrdocs: 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_deque.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void swap(xref:bsl/deque-0c.adoc[deque<VALUE_TYPE, ALLOCATOR>]& other) noexcept(AllocatorTraits::is_always_equal::value); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#