Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wordsmithing

...

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 intent 's intention was to use the correct dynamic type for the underlying object:

...