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) (C++17 이후)
std:: weak_ptr < T const > weak_from_this ( ) const noexcept ;
(2) (C++17 이후)

std:: weak_ptr < T > 를 반환하며, 이는 현재 존재하는 모든 std::shared_ptr * this 를 참조하는 소유권을 추적합니다.

목차

반환값

weak_this

참고 사항

기능 테스트 매크로 표준 기능
__cpp_lib_enable_shared_from_this 201603L (C++17) std::enable_shared_from_this::weak_from_this

예제

참고 항목

(C++11)
공유 객체 소유권 의미론을 가진 스마트 포인터
(클래스 템플릿)