다음을 통해 공유


operator<<(<memory>)

shared_ptr inserter.

template<class Elem, class Tr, class Ty>
    std::basic_ostream<Elem, Tr>& operator<<(std::basic_ostream<Elem, Tr>& out,
    shared_ptr<Ty>& sp);

매개 변수

  • Elem
    The type of the stream element.

  • Tr
    The type the stream element traits.

  • Ty
    공유 포인터에 제어되는 형식입니다.

  • out
    출력 스트림입니다.

  • sp
    The shared pointer.

설명

The template function returns out << sp.get().

예제

 

// std_tr1__memory__operator_sl.cpp 
// compile with: /EHsc 
#include <memory> 
#include <iostream> 
 
int main() 
    { 
    std::shared_ptr<int> sp0(new int(5)); 
 
    std::cout << "sp0 == " << sp0 << " (varies)" << std::endl; 
 
    return (0); 
    } 
 
  

요구 사항

헤더 <memory>

네임스페이스: std

참고 항목

참조

shared_ptr 클래스

기타 리소스

<memory> 멤버