解决方法
override
是Microsoft的特殊关键字扩展,可用于C/C++LI和Visual C实现.它类似于Java中的
@Override
注释或C#中的
override
,并提供更好的编译时间检查,以防您没有覆盖您想要的内容.
从第一个链接:
override indicates that a member of a managed type must override a base class or a base interface member. If there is no member to override,the compiler will generate an error.
override is also valid when compiling for native targets (without /clr). See Override Specifiers and Native Compilations for more information.
override is a context-sensitive keyword. See Context-Sensitive Keywords for more information.
从C 11标准开始,覆盖说明符现在是标准化关键字.支持仍然有限,根据此page from Apache StdCxx,GCC 4.7,Intel C 12.0和Visual C 2012支持覆盖(在Visual C 2005中具有预标准化支持).