12.07.2015 Views

dangling pointer

dangling pointer

dangling pointer

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Pragmatism First (cont.)boost::shared_ptr sp(new X);// Get the raw <strong>pointer</strong>X* p = sp.get();Use boost::shared_ptr::get() only to pass the raw <strong>pointer</strong> tolibrary/system functions that expect a <strong>pointer</strong> and do not take ownership of the<strong>pointer</strong>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!