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 (guest, #65977)
Posted Feb 15, 2013 20:26 UTC (Fri) by marcH (subscriber, #57642)
Posted Feb 15, 2013 22:33 UTC (Fri) by efraim (guest, #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 © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds