Key Takeaways
Get a recap of all the concepts learned in this chapter.
We'll cover the following...
We'll cover the following...
While declaring local variables const is desirable, let’s avoid declaring member variables as const.
constmember variables cannot be changed, so a class withconstmembers loses copy assignment and move semantics.- Using
const_castmight lead to undefined behaviour, so we won’t use it as a workaround in the above mentioned special functions. - Whenever we see
constmembers in a class during a code review (or in already checked-in code), remember what we just learned.