const _cast VS mutable ? есть разница?

Насколько я понимаю, 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;
}

Итак, что же отличает одно от другого?

Спасибо

8
задан JAN 12 July 2012 в 18:09
поделиться