Boost logo

Boost :

From: Ian Bruntlett (Ian.Bruntlett_at_[hidden])
Date: 2000-03-29 02:48:03


Hi,

Well, I've been kicking myself over confusing operator~ with the destructor.
Doh.

Here's an update of the idea:-

I've looked at the auto_ptr<> documentation more closely and here's how I'd
suggest implementing auto_resource<> at the moment.
1. Take the source for auto_ptr<> and replace auto_ptr with auto_resource.
2. Remove the implementation code for member reset()
3. Remove the implementation code for member release()

To use auto_resource<>, the end user would have to implement template
specialisations of reset() and release(), using a similar mechanism to
similar posts.

I think that would work for most handle based resources. But I'll play
around with the idea later, looking at the consequences of auto_resource<>
and get(), operator*, operator->

There is the issue that it relies on template features that might not have
been implemented by all compilers yet. That will be fixed by the compiler
vendors in due course of time.

I think a clean library implementation would implement auto_resource. Then
it would implement auto_ptr in terms of auto_resource. But that is a problem
someone else will have to deal with...

Ian


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