Documentation Home >> Headers >> <jss/experimental_atomic.hpp> Header >> std::experimental::weak_ptr >> std::experimental::weak_ptr Heterogeneous move assignment operator

Replaces the value in a std::experimental::weak_ptr with the value in another std::experimental::weak_ptr, transferring ownership from the supplied std::experimental::weak_ptr to *this.

template<typename Other>
weak_ptr& operator=(weak_ptr<Other>&& other) noexcept;

Effects:
template<typename Other>
weak_ptr& operator=(weak_ptr<Other>&& other) noexcept{
    weak_ptr temp(std::move(other));
    this->swap(temp);
    return *this;
}
Header

#include <experimental/atomic>

See Also