Namespaces
Variants

std::experimental:: weak_ptr

From cppreference.net
헤더 파일에 정의됨 <experimental/memory>
template < class T > class weak_ptr ;
(라이브러리 fundamentals TS)

std::experimental::weak_ptr std::weak_ptr 의 수정된 버전으로, std::experimental::shared_ptr 와 상호 운용되며 배열에 대한 지원을 포함합니다.

목차

멤버 타입

멤버 타입 정의
element_type std:: remove_extent_t < T >

멤버 함수

새로운 weak_ptr 을 생성합니다
(public member function)

std::weak_ptr와 동일한 멤버 및 비멤버

멤버 함수

다음 멤버 함수들은 std::experimental::shared_ptr 와 함께 동작하며 std::shared_ptr 대신 사용되고, std::experimental::weak_ptr std::weak_ptr 대신 사용됩니다. 그 외의 동작은 동일합니다.

weak_ptr 을 파괴함
( std::weak_ptr<T> 의 public 멤버 함수)
weak_ptr 을 할당함
( std::weak_ptr<T> 의 public 멤버 함수)
수정자
관리 객체의 소유권을 해제함
( std::weak_ptr<T> 의 public 멤버 함수)
관리 객체들을 교환함
( std::weak_ptr<T> 의 public 멤버 함수)
관찰자
객체를 관리하는 shared_ptr 객체의 수를 반환함
( std::weak_ptr<T> 의 public 멤버 함수)
참조된 객체가 이미 삭제되었는지 확인함
( std::weak_ptr<T> 의 public 멤버 함수)
참조된 객체를 관리하는 shared_ptr 을 생성함
( std::weak_ptr<T> 의 public 멤버 함수)
weak 포인터의 소유자 기반 순서를 제공함
( std::weak_ptr<T> 의 public 멤버 함수)

비멤버 함수

이 비멤버 함수는 std::experimental 네임스페이스에서 선언되며, std::experimental::weak_ptr 와 함께 동작하고 std::weak_ptr 대신 사용되지만, 그 외에는 해당 C++14 함수와 동일하게 동작합니다.

std::swap 알고리즘을 특수화함
(함수 템플릿)

예제