Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 1999-07-13 08:47:35


Kevlin Henney wrote:

> It also uses up
> the null bandwidth, which I tend to reserve for "not counted", ie
> passing a non-counted object into a function that accepts only a counted
> ptr; w/ a null counter the smart pointer acts as an adaptor for its own
> type. Should we consider this for shared_ptr? Eg
>
> T t;
> shared_ptr<T> p(&t, nocount);

So:

1) you are introducing a function which, for some reason,
can only deal with counted objects

2) then you are using this function with non counted objects

This seems absolutly contradicting, and certainly note
somethign standard or tat should be supported by standard
(industry standard components (boost)).

If the programmer cannot understand the difference between
T* and shared_ptr<T>, fire him. Same solution if he
systematically writes shared_ptr<T> when he means T*.

Simple solutions (well, maybe note from the legal point
of view) for simple problems.

> Ah. I hadn't realized we were talking specifically about reference-counted
> objects. I thought it was a statement about the behavior of bad_alloc in
> general that I'd never heard of. Never mind.

Actually bad_alloc has about as much behaviour as int. That
is to say that it's a value with no behaviour at all.

-- 
Valentin Bonnard
------------------------------------------------------------------------
eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications

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