20 Memory management library [mem]

20.3 Smart pointers [smartptr]

20.3.2 Shared-ownership pointers [util.sharedptr]

20.3.2.2 Class template shared_ptr [util.smartptr.shared]

20.3.2.2.4 Assignment [util.smartptr.shared.assign]

constexpr shared_ptr& operator=(const shared_ptr& r) noexcept; template<class Y> constexpr shared_ptr& operator=(const shared_ptr<Y>& r) noexcept;
[Note 1: 
The use count updates caused by the temporary object construction and destruction are not observable side effects, so the implementation can meet the effects (and the implied guarantees) via different means, without creating a temporary.
In particular, in the example: shared_ptr<int> p(new int); shared_ptr<void> q(p); p = p; q = p; both assignments can be no-ops.
— end note]
constexpr shared_ptr& operator=(shared_ptr&& r) noexcept; template<class Y> constexpr shared_ptr& operator=(shared_ptr<Y>& r) noexcept;
Returns: *this.
template<class Y, class D> constexpr shared_ptr& operator=(unique_ptr<Y, D>& r);
Returns: *this.

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant