News for hackers. Stuff that matters.
Re:In the C++ bag of tricks: scoped locks by twoodfin on Friday February 07, 2014 @12:40PM (#7197532)
Yeah, they even admit that their macro compiles to identical code as the original RAII version. Where's the "overhead"?

As a general rule, if your C++ compiler can statically see the layout of your structures and the implementation of your functions, it will produce code as efficient as inlining everything yourself. Sufficiently complex functions make the benefits of inlining a judgment call on the compiler's part, but for something as simple as an RAII scoped lock, the abstraction is free.

There are no comments on this comment yet.