|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2007-11-09 02:49:25
Ulrich Eckhardt wrote:
>
> I have a library here which I would propose for addition to Boost. It is a
> wrapper around a resource handle, just like std::auto_ptr is a wrapper around
> a pointer. The main difference to std::auto_ptr is that it doesn't overload
> operator-> and that it can (or, rather, must) be customized. Therefore it can
> also be used to hold resources like 'int' (a Unix filedescriptor) or 'FILE*'
> and also has the known ownership transfer semantics of std::auto_ptr.
I'm interested. Long ago, I wrote something very much like what you
describe (see
http://msdn.microsoft.com/msdnmag/issues/03/06/ResourceManagement/default.aspx),
and used it effectively to plug the resource leaks in an application I
inherited. I think there is a need for more general RAII resource managers.
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk