Boost logo

Boost :

From: Alisdair Meredith (alisdair.meredith_at_[hidden])
Date: 2002-01-30 13:16:09


OK, I'll come clean, I was recently reading the Exception Safe Coding topics in Herb's Sutter's Exceptional C++, and instantly found somewhere to apply the technique in my current project!

I am impleting some 'refresh' functionality where I fetch the latest view of my data from our database. This is currently stored in a struct of scoped_ptrs, to reflect ownership and that the possibilty of missing data (null pointer). The way I want to implement this is to build another of these structs from a sequence of database queries, and then swap the internal representation if it all succeeds. Unfortunately, as scoped_ptr doesn't support swap, I can't do this.

For a quick-fix I have resorted to shared_ptr, although that implies things about my data that I don't want to (namely that it might be shareable). Am I missing some incredibly obvious reason why it would be bad to support swapping scoped_ptrs?

AlisdairM

----------------------------------------------------------------------

For further information on Renault F1 visit our web site at www.renaultf1.com. This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please destroy and notify Renault F1 on +44 1608678000."

----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk