Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-08-16 12:52:20


From: "Peter Dimov" <pdimov_at_[hidden]>
> From: <williamkempf_at_[hidden]>
> > Well, the preferred method shortens the pattern a little:
> >
> > {
> > mutex::scoped_lock lock(m);
> > cv.wait(lock, pred);
> > action();
> > }
>
> Yes; the real problem is that without Lambda, there is no simple way to
> define 'pred' in-place.
>
> The perfect syntax would be
>
> cv.wait(q.empty(), command = q.pop());
>
> How close can we get within std C++ to it?

I should think that with expression templates you could get
very close.


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