std::enable_shared_from_this<T>::weak_from_this

Returns a std::weak_ptr that tracks ownership of *this by all existing std::shared_ptr that refer to *this.

# Declarations

std::weak_ptr<T> weak_from_this() noexcept;

(since C++17)

std::weak_ptr<T const> weak_from_this() const noexcept;

(since C++17)

# Return value

weak_this

# Notes

Feature-test macro Value Std Feature __cpp_lib_enable_shared_from_this 201603L (C++17) std::enable_shared_from_this::weak_from_this

# Example

This section is incompleteReason: no example

# See also