Exchange the states of the specified weak_ptr objects a and b.

Synopsis

Declared in <bslstl_sharedptr.h>

template<class ELEMENT_TYPE>
void
swap(
    weak_ptr<ELEMENT_TYPE>& a,
    weak_ptr<ELEMENT_TYPE>& b) noexcept;

Description

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.

Parameters

Name

Description

a

first object to exchange

b

second object to exchange

Created with MrDocs