
16 Jul
2004
16 Jul
'04
12:05 a.m.
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.