Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
How many non-newbie C++ programmers have you met for real? Three? Five?
Should be: Goodnight, Perl 6.
Posted Feb 15, 2013 8:26 UTC (Fri) by efraim (subscriber, #65977)
Posted Feb 15, 2013 20:26 UTC (Fri) by marcH (subscriber, #57642)
Posted Feb 15, 2013 22:33 UTC (Fri) by efraim (subscriber, #65977)
1. If you get a shared_ptr or unique_ptr you can store it for use later.
2. Otherwise (if you get a raw pointer or a reference) you have to assume that you do not own the resource and can only use it in the method's scope.
3. By calling .get() you are saying you are going to take care of ensuring the object's existence during your use of the pointer - i.e. you get no help all bets are off.
Posted Feb 16, 2013 1:01 UTC (Sat) by marcH (subscriber, #57642)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds