std::enable_shared_from_this<T>::operator= (3) - Linux Manuals
std::enable_shared_from_this<T>::operator=: std::enable_shared_from_this<T>::operator=
NAME
std::enable_shared_from_this<T>::operator= - std::enable_shared_from_this<T>::operator=
Synopsis
enable_shared_from_this<T>& operator=( const enable_shared_from_this<T> &obj ) noexcept; (since C++11)
Does nothing; returns *this.
Parameters
obj - an enable_shared_from_this to assign to *this
Return value
*this
Notes
The private std::weak_ptr<T> member is not affected by this assignment operator.
Example
Note: enable_shared_from_this::operator= is defined as protected in order to prevent accidental slicing but allow derived classes to have default assignment operators.
// Run this code
Output:
See also
shared_ptr smart pointer with shared object ownership semantics
(C++11)