Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-07-13 11:43:46


At 10:37 AM 7/13/2001, Peter Dimov wrote:

>> They are currently unspecified. At least for now, that's probably
>> best. See below.
>
>IOW, a linked-list implementation is conforming. This is good. :-)

Yes.

Complexity requirements can help ensure that application programs ported to
other library implementations still perform reasonably.

But there can be a real downside. They discourage implementors from
innovating. They are hard to specify correctly. They effectively add to
the cost of standardization. So they should only be used where there is a
major advantage to doing so.

>
>> >An interesting related question is "why does shared_ptr have
>use_count?"
>>
>> As an aid to writing test cases and debugging displays. One of the
>> progenitors had use_count(), and it was useful in tracking down bugs in
a
>> complex project that turned out to have cyclic-dependencies.
>
>This should probably be documented (along with the decision to not
specify
>complexity requirements.)

Done.

>Why is this important? Because some nice interface additions to
shared_ptr
>(my shared_ptr_id proposal, for instance) would be inappropriate under a
>linked-list implementation.
>
>Perhaps this deserves a new FAQ entry:
>
>Q: Why doesn't shared_ptr provide (your pet feature here)?
>A: Because (your pet feature here) would mandate a reference counted
>implementation. This is not the intent.

Added. Thanks! And thanks to Christian for posing the questions in the
first place.

--Beman


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