다음을 통해 공유


weak_ptr::element_type

요소의 형식입니다.

typedef Ty element_type;

설명

The type is a synonym for the template parameter Ty.

예제

 

// std_tr1__memory__weak_ptr_element_type.cpp 
// compile with: /EHsc 
#include <memory> 
#include <iostream> 
 
int main() 
    { 
    std::shared_ptr<int> sp0(new int(5)); 
    std::weak_ptr<int> wp0(sp0); 
    std::weak_ptr<int>::element_type val = *wp0.lock(); 
 
    std::cout << "*wp0.lock() == " << val << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더 <memory>

네임스페이스: std

참고 항목

참조

weak_ptr 클래스