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-16 andrew

    Web Browser 컨트롤

    Web Browser Control FAQ   다음의 FAQ(FAQ라고 하기도 뭐 합니다만.. )는 제가 VC++ Q&A 에서 그 동안 봐왔던 Web Browser...
  • 2014-08-09 andrew

    한글 초성알아내기

    원글 : http://ehclub.tistory.com/entry/%ED%95%9C%EA%B8%80-%EC%B4%88%EC%84%B1-%EC%95%8C%EC%95%84%EB%82%...
« 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