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

Replaces the value in a std::experimental::shared_ptr with a copy of the value in another std::experimental::shared_ptr, decreasing the use_count() of the old value and increasing the use_count() of the new one.

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

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

#include <experimental/atomic>

See Also