Boost logo

Boost :

From: Dirk Gregorius (dirk_at_[hidden])
Date: 2004-12-28 16:16:05


Dear group,

is it possible to use smart_ptr with handles ( e.g. HWND, HBRUSH, HDC,
etc )? Wouldn't it be quite convenient to have something like a scoped
or shared resource? The idea came when I looked my OpenGL initialisation
code, where I have to free the resource explictly every time an error
occurs, which make the code somehow a little bit more difficult to read
and I though that it would be nice to have some kind of RAII mechanism
here.

Regards,

-Dirk


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