GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::weak_ptr::operator=(3) C++ Standard Libary std::weak_ptr::operator=(3)

std::weak_ptr::operator= - std::weak_ptr::operator=


weak_ptr& operator=( const weak_ptr& r ) noexcept; (1) (since C++11)
template< class Y > (2) (since C++11)
weak_ptr& operator=( const weak_ptr<Y>& r ) noexcept;
template< class Y > (3) (since C++11)
weak_ptr& operator=( const shared_ptr<Y>& r ) noexcept;
weak_ptr& operator=( weak_ptr&& r ) noexcept; (4) (since C++11)
template< class Y > (5) (since C++11)
weak_ptr& operator=( weak_ptr<Y>&& r ) noexcept;


Replaces the managed object with the one managed by r. The object is shared with r.
If r manages no object, *this manages no object too.


1-3) Equivalent to std::weak_ptr<T>(r).swap(*this).
4,5) Equivalent to std::weak_ptr<T>(std::move(r)).swap(*this).


r - smart pointer to share an object with


*this


The implementation may meet the requirements without creating a temporary weak_ptr
object.


Defect reports


The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.


DR Applied to Behavior as published Correct behavior
LWG 2315 C++11 move semantic was not enabled for weak_ptr enabled


constructor creates a new weak_ptr
(public member function)
swap swaps the managed objects
(public member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.