Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Adding links to definitions

...

In this compliant solution, the upcast is removed, rendering the initial code ill-formed and emphasizing the underlying problem: that B::g() does not exist. This compliant solution assumes that the programmer's intention was to use the correct dynamic type for the underlying object:

...