I read a c++ book written by Stroustrup. He said that a virtual function has to be redeclared exactly the same way to be overriden. So I wrote a function that's not exactly the same as in the base class.(It doesn't have " const") But when I call the function. It's still the function in the derived calss being called. So does that mean the virtual function hasn't been overridden? Or is there any other way to explain it?
【在 w*****j 的大作中提到】 : I read a c++ book written by Stroustrup. He said that a virtual function has : to be redeclared exactly the same way to be overriden. So I wrote a : function that's not exactly the same as in the base class.(It doesn't have " : const") But when I call the function. It's still the function in the derived : calss being called. So does that mean the virtual function hasn't been : overridden? Or is there any other way to explain it?