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

Replaces the value in a std::experimental::shared_ptr with the value in another std::experimental::shared_ptr, transferring ownership from the supplied std::experimental::shared_ptr to *this and decreasing the use_count() of the old value.

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

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

#include <experimental/atomic>

See Also