choeger
choeger

Reputation: 3567

Ensure that a class is not abstract

When I change the signature of a virtual method, it happens quite frequently, that inheriting classes become abstract. This might lead to (confusingly large) error messages at apparently completely unrelated (to the original change) locations. Somewhere in these messages, I read "Foo is abstract". But parsing these error messages is tedious. Is there a way to enforce that a class is not abstract?

Upvotes: 4

Views: 227

Answers (1)

463035818_is_not_an_ai
463035818_is_not_an_ai

Reputation: 122830

You can use the override specifier to specify that a method in the derived class overrides the abstract method in the base class. When you change the signature of the method in the base class, the override specified method should cause a clear compiler error because because it no longer overrides the base class method.

Upvotes: 9

Related Questions