Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualiMalc

Posted 09 February 2013 - 04:16 PM

But if i take it by const reference, how do i prevent the original object from deleting the resource upon destruction?

By using a shared_ptr to that resource.

It might be good if you would show some more of your code for some more specific help. Also make sure you know about, or learn, the rule of three. And for bonus points, this site has an excellent selection of articles about the nuances of C++: http://www.gotw.ca/gotw/

#1iMalc

Posted 09 February 2013 - 04:14 PM

But if i take it by const reference, how do i prevent the original object from deleting the resource upon destruction?

By using a shared_ptr to that resource.

PARTNERS