Quote Originally Posted by Zaccheus View Post
Interesting, but I don't see the relevance as it talks about derived classes changing the behaviour. That article however shows why I dislike non-private data members.
If the classes in your example have non-virtual assignment operators, then the code below would change the contents of the string without the assignment operator of the derived class being called.
Code:
void foo(String& s)
{
    s = String("foo");
}

void bar()
{
    FastString s("foobar");
    foo(s);
    // uh oh, s.length() is incorrect
}
For this example to work correctly, the base class' assignment operator has to be virtual and the derived class needs an overloaded assignment operator taking a base class object (to override the virtual function in the base class).