The gotcha of the C++ temporaries that don’t destruct as eagerly as you thought -- Raymond Chen
Worth waiting for:
The gotcha of the C++ temporaries that don’t destruct as eagerly as you thought
by Raymond Chen
From the article:
Forgetting to take a lock when updating variables is a common mistake. One way to make the mistake harder to make is to force the access to occur through some mechanism that proves that you possess the lock. Maybe something like this: ...