1

Is there any current way, or possibly planned standards change, that would allow me to require an overridden virtual function use the override keyword?

class base {
    virtual void foo() = 0; //what, if anything, can I do here so that...
}

class derived {
    void foo(); //...this is an error...
    void foo() override; //...and only this accepted
}
edA-qa mort-ora-y
  • 30,295
  • 39
  • 137
  • 267

1 Answers1

0

No, there is no such feature in C++. You could enforce it with a static analysis tool, perhaps.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436