Basically, I want the C # compiler to execute its override keyword in my C ++ code.
class Base { virtual int foo(int) const; }; class Derived : public Base { virtual int foo(int);
As we all know, the above code will compile fine, but brings some weird behavior at runtime. I would like my C ++ compiler to catch my poor implementation with something like the C # override . Are there any keywords like "override" implemented in C ++, or do we stick with #define override virtual to show our intent? (in fact, I do not do this - I hate using a preprocessor to "extend" the language).
c ++ override virtual
franji1
source share