Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-09-06 16:11:00


From: William Kempf <williamkempf_at_[hidden]>
> From: dmoore_at_[hidden]
>
> >4. In semaphore::up(), I hadn't seen the idiom of "!!" before.
> >
> > bool ret = !!ReleaseSemaphore(reinterpret_cast<HANDLE>(m_sema),
> count, &p);
> >
> >At first glance, I thought this was a bug (it's not), but it seems a bit
> >odd. Would a cast from BOOL to bool or a comment be more clear?
>
> It's a fairly common idiom (given the name "bang bang") that I expect many
> (most?) people to be aware of. The cast may be more appropriate, it's just
> a pain to code, and a comment would be even worse yet. I'm not sure what
> others think about this idiom.

I recall Max once referring to !! as the "boolean conversion operator" ;->


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