The solution to GotW #6a is now available:
GotW #6a Solution: Const-Correctness, Part 1 (updated for C ++11/14)
by Herb Sutter
From the article:
Starting with C++11,
conston a variable that is possibly shared means read-only, safe to read concurrently without external synchronization.If you perform any operation on a
constshared variablex, or call a const member function onx, you can assume that operation does not change the observable value ofx-- or even modify the bits ofxin an observable way even in the presence of concurrency. ...Guideline: Remember the “M&M rule”: For a member variable,
mutableandmutex(oratomic) go together. ...

Add a Comment
Comments are closed.