Andrew's Garage

Shrunk Expand

Primary Navigation

tip for auto_ptr with C++

1. how to test whether auto_pointer is null?

if (!myPointer.get()) {
    // do not dereference here
}

2. how to pass auto_pointer ?

std::auto_ptr<class>  ptr_class = std::auto_ptr( new class );

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)

Related


Posted on 2015-06-10 8:09 PM by andrew Comment
📂This entry was posted in C/C++

Related Posts

  • 2014-07-09 andrew

    [Tip] CMenu를 이용하여 팝업메뉴 만들기

     트랙백 주소 : http://www.tipssoft.com/bulletin/tb.php/FAQ/244   팁스소프트에서 제공하는 프로그래밍과 관련된 자료나 정보들을 무단으로 복제...
  • 2014-07-16 andrew

    이번 포스팅은 특정사이트의 HTML 태그를 가져와서 출력하는 것까지 다룹니다. 개발 툴은 Visual Studio 2012를 사용했습니다. # 화면 구성 - url 영역 - url...
« how to make debug build on cmake CMAKE compile options and etc options »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

( optional )


©2025 boots Entries RSS and Comments RSS Child theme Boots of Raindrops Theme