Exchange the states of the specified weak_ptr objects a and b.
Declared in <bslstl_sharedptr.h>
template<class ELEMENT_TYPE>
void
swap(
weak_ptr<ELEMENT_TYPE>& a,
weak_ptr<ELEMENT_TYPE>& b) noexcept;
Efficiently exchange the states of the specified a and b weak pointers such that each will refer to the object (if any) and representation formerly referred to by the other.
| Name | Description |
|---|---|
| a | first object to exchange |
| b | second object to exchange |