Насколько я понимаю, mutable
отменяет constness
переменной
Class A {
void foo() const {
m_a = 5;
}
mutable int m_a;
};
Но иconst_cast
:
void print (char * str)
{
cout << str << endl;
}
int main () {
const char * c = "this is a line";
print ( const_cast<char *> (c) );
return 0;
}
Итак, что же отличает одно от другого?
Спасибо