Namespaces
Variants

std::enable_shared_from_this<T>:: weak_from_this

From cppreference.net
Memory management library
( exposition only* )
Allocators
Uninitialized memory algorithms
Constrained uninitialized memory algorithms
Memory resources
Uninitialized storage (until C++20)
( until C++20* )
( until C++20* )
( until C++20* )

Garbage collector support (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
(C++11) (until C++23)
std:: weak_ptr < T > weak_from_this ( ) noexcept ;
(1) (seit C++17)
std:: weak_ptr < T const > weak_from_this ( ) const noexcept ;
(2) (seit C++17)

Gibt einen std:: weak_ptr < T > zurück, der den Besitz von * this durch alle bestehenden std::shared_ptr verfolgt, die auf * this verweisen.

Inhaltsverzeichnis

Rückgabewert

weak_this

Hinweise

Feature-Test Makro Wert Std Feature
__cpp_lib_enable_shared_from_this 201603L (C++17) std::enable_shared_from_this::weak_from_this

Beispiel

Siehe auch

(C++11)
Intelligenter Zeiger mit Shared-Object-Ownership-Semantik
(Klassentemplate)