Boost logo

Boost :

From: Matt Hurd (matt.hurd_at_[hidden])
Date: 2004-07-15 19:05:15


> Eric Niebler wrote:
> > David Abrahams wrote:
> >> BTW, it just occurred to me that
<snip>
> On second thought, I think it's too subtle. You can detect literal zero,
> but you can't detect (at compile-time) an int with a value of zero. I'm
> not comfortable with this:
>
> scoped_lock l(m, 0);
>
> meaning something different than:
>
> int t = 0;
> scoped_lock l(m, t);
>
> Perhaps it's really OK because the effect is the same, but the fact that
> they would execute different code paths sets off bells in my head.

Perhaps the interface should be
    lock lk<0>(m);
    lock lk<33>(m);
    lock lk(m);
to support specialization of zero.

I can see a case for allowing both to allow run-time discrimination...
needs more thought.

Matt Hurd.


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