Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualKing Mir

Posted 06 February 2013 - 08:09 PM

I'm curious about that video but I'm working with bandwidth limits here. Is there a print source that describes the change? Googling "C++11 const changes" didn't get me anywhere interesting.

 

Basically Sutter says that the standard library can only guarantee race condition free, and therefore well defined, use if all const parameters passed to it are never modified, or are internally synchronized. He therefore says that if you do need to modify the state of a const object, you should only do it though internally synchronized objects that are declared mutable. He goes on to say that mutable should be used by default on all internally synchronized objects, like atomics and mutexes.

 

Therefore "const" means "thread safe", and "mutable" means "internally synchronized".

 

This is a more stringent constraint on const than implied by the previous standard and Sutter says that any code using const_cast or mutable should be examined in light of the change.


#1King Mir

Posted 06 February 2013 - 08:03 PM

I'm curious about that video but I'm working with bandwidth limits here. Is there a print source that describes the change? Googling "C++11 const changes" didn't get me anywhere interesting.

 

Basically Sutter says that the standard library can only guarantee race condition free use if all const parameters passed to it are never modified, or are internally synchronized. He therefore says that if you do need to modify the state of a const object, you should only do it though internally synchronized objects that are declared mutable. He goes on to say that mutable should be used by default on all internally synchronized objects, like atomics and mutexes.

 

Therefore "const" means "thread safe", and "mutable" means "internally synchronized".

 

This is a more stringent constraint on const than implied by the previous standard and Sutter says that any code using const_cast or mutable should be examined in light of the change.


PARTNERS