Boost logo

Boost :

From: Ross Smith (r-smith_at_[hidden])
Date: 2003-07-18 18:24:21


On Saturday 19 July 2003 09:21, John Madsen wrote:
> "Eugene Lazutkin" <eugene.lazutkin_at_[hidden]> wrote:
> >
> >4) Sometimes destruction of handles is more than a simple call to
> >one-argument procedure. Real example from Windows, which is
> > encountered frequently:
> >
> >HDC hDC = GetDC(hWindow);
> >// do some drawing...
> >ReleaseDC( hWindow, hDC );
> >
> >In this example destruction (releasing) involves some kind of
> > context (window handle). Apparently it is not handled by proposed
> > library.
>
> Thanks for this example. I had not considered cases like this and
> will think more about it.

This is easily handled; just use boost::bind(ReleaseDC, hWindow, _1) for
the release function.

-- 
Ross Smith ......... r-smith_at_[hidden] ......... Auckland, New Zealand
  "As Unix guru types go, I'm sweet, patient, and comprehensible.
  Unfortunately, Unix guru types don't go very far in that direction.
  I used to think this was a personality flaw." -- Elizabeth Zwicky

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