Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2003-08-28 18:17:49


On Thursday 28 August 2003 06:26 pm, E. Gladyshev wrote:
> --- Gregory Colvin <gregory.colvin_at_[hidden]> wrote:
> > Perhaps because you work with the authors of the documentation to
> > make it sure it says what needs saying?
>
> Are the documentation authors monitoring this mailing list?

The developers generally write the documentation, or at the very least have
authority over what it says.

> How about
>
> template< typename T, typename Counter = int >
> shared_ptr
> {
> typedef Counter counter; //counter type should be public
>
> template <typename DataAlloc = std::allocator<T>, typename
> CounterAlloc=std::allocator<counter>
>
> shared_ptr( const DataAlloc& da = DataAlloc(), const IntAlloc ia& =
> CountAlloc() ); };

I suggest that you:
        (1) flesh out the interface you want,
        (2) decide what the specific semantics of the interface are, and
        (3) put together at least a toy implementation (at least try to compile the
interface specification; the above isn't valid C++, for instance); then
        (4) start a new thread to discuss the semantics you need and the syntax you
want.

> Actually this is probably what the whole thread is about
> to get people to try to find the best practicle solution
> for memory management in the modern C++ age.
> I am not sure that STL style allocators is the best
> possible solution.

Nor is anyone else. But the point is that grand visions cannot go anywhere
without specific examples. Remember: Boost policies are implemented bottom-up
not top-down.

You have suggested a way to fix your problem for shared_ptr, and I suggest you
follow my recommendation above to come up with a proposal that does what you
need (but do note the comments Peter has already made regarding interfaces
similar to the one you suggest above).

        Doug


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