I have my build configured to give compiler warnings for unused variables. I use scoped_locks liberally in my code, and am curious as to how local instances of scoped locks circumvent the warning.
So my question is, why do boost::scoped_lock's not generate an unused variable compiler warning?
Example code:
void myFunc() {
boost::mutex::scoped_lock lock(_mutex) // no compiler warning
var a; // Compiler warning
}