From: Hossein Haeri [mailto:powerprogman@yahoo.com] Sent: Wednesday, April 30, 2003 8:29 AM
I want to know what the following means:
int a = 5; const boost::shared_ptr<int> sp(&a);
I assume you know this, but this code is in error. When the last shared_ptr referencing &a goes away, it will try to delete a, which is illegal. There is a workaround defined at http://www.boost.org/libs/smart_ptr/sp_techniques.html#static , though. ----------------------------------------------------------------------- DISCLAIMER: Information contained in this message and/or attachment(s) may contain confidential information of Zetec, Inc. If you have received this transmission in error, please notify the sender by return email. -----------------------------------------------------------------------
participants (1)
-
Tom Matelich