Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Thank you for this suggestion. I was hoping to have to avoid a wrapper Class since it would be quite a lot of refactorisation. Commented Oct 11, 2024 at 16:01
  • I assume you meant to make double multiply a virtual method instead of just hiding the base method. The hidden base method will remain accessible when you cast a MyClass instance to its base type. Commented Oct 14, 2024 at 12:27
  • @Thibe It was not necessary for the sake of the example, but anyway, it's a protected member function so it won't be accessible from the outside world anyway (so the cast to the base type won't expose it) Commented Oct 15, 2024 at 9:52