Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-05-24 09:01:41


I have some comments on shared_ptr.

1. Isn't specializing std::less without defining the corresponding operator<
setting a dangerous precedent? This means that sort(f, l) and sort(f, l,
less<>()) could potentially give different results.

2. I need to access shared_ptr::pn. Really.

Consider this case:

shared_ptr<A> pa;
shared_ptr<B> pb;

Do pa and pb point to the same object? No way to tell without comparing
pa.pn and pb.pn.

Why does this matter? Suppose that I have a persistence library and I want
to 'persist' shared_ptr's. I'm given a shared_ptr<X> that has an use_count()
of 2. Has the object already been written to disk? A set of pn's would
answer this question easily, but without access to shared_ptr::pn, I can't
build this set.

--
Peter Dimov
Multi Media Ltd.

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