Why is const-correctness specific to C++?

后端 未结 14 600
盖世英雄少女心
盖世英雄少女心 2020-12-23 16:42

Disclaimer: I am aware that there are two questions about the usefulness of const-correctness, however, none discussed how const-correctness is necessary in C++ as oppos

14条回答
  •  醉酒成梦
    2020-12-23 17:10

    This talk and video from Herb Sutter explains the new connotations of const with regards to thread-safety.

    Constness might not have been something you had to worry about too much before but with C++11 if you want to write thread-safe code you need to understand the significance of const and mutable

提交回复
热议问题