Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-07-13 09:07:26


At 06:35 AM 7/13/2001, Peter Dimov wrote:

>I think that Christian has a valid question that is not addressed by
Modern
>C++ Design:
>
>What are the complexity requirements of the boost::shared_ptr<> member
>functions?

They are currently unspecified. At least for now, that's probably
best. See below.

>He asks, if I understand correctly, not how boost::shared_ptr is
currently
>_implemented_, but how it's _defined_.
>
>A question that will become more important if/when shared_ptr moves into
>std.

My guess is the committee won't want to specify complexity requirements,
because they limit implementors and complicate the specification without
apparent benefit to users. Almost certainly, someone will point out that
some error-checking implementations might become non-conforming if they
have to meet a stringent complexity requirement.

In other words, it will be seen as a quality of implementation issue, not a
specification issue.

But remember that anticipating how the LWG will look at a proposal isn't a
always possible. There is a very wide range of viewpoints present,
including vendors, implementors, teachers, presenters, authors. Some view
a library through the lens of user problem reports, for example, and so see
many issue very differently from typical Boost members.

>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.

--Beman


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