News for hackers. Stuff that matters.
Re:In the C++ bag of tricks: scoped locks by mojuba on Friday February 07, 2014 @04:09PM (#7198743)
Wouldn't this be exception-safe, provided lock_iter defines a ctor, dtor, operator bool() and operator ++()?

    #define LOCKED(lk) for (lock_iter i = lk; i; i++)
(Edit: I thought lock_iter could be an empty class but no, it can not, so I edited my post. lock_iter will have an internal flag that should be optimized away following the same logic int i is optimized in the OP's version)

There are no comments on this comment yet.