
On Mon, Jun 27, 2011 at 10:53 AM, Antony Polukhin <antoshkka@gmail.com>wrote:
2011/6/27 Jeffrey Lee Hellrung, Jr. <jeffrey.hellrung@gmail.com>:
Forgive me as I don't know the entire context of this, but would boost::scoped_ptr be sufficient here? One would never transfer the ownership of the object referenced by std::auto_ptr, would they?
Yes, you are right. boost::scoped_ptr will suit better. Thank you.
Antony and Jeffrey,
An improved version of Singularity is now available at https://github.com/icaretaker/Singularity. I have reimplemented Singularity using the scoped_ptr<T>. After further research, I am convinced the volatile keyword was useless, given that all accesses to the shared pointer were fenced by acquisition of a boost::mutex. This greatly simplifies the implementation. Also, should the user fail to call Singularity<T>::destroy(), the destructor for the instance of T will be called when the program exits, as this is when the static scoped_ptr<T> goes out of scope. Thanks again, Ben Robinson, Ph.D. Best regards,
Antony Polukhin _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost