C.140: Do not provide different default arguments for a virtual function and an overrider
C.140:不要为虚函数和它的覆盖函数设定不同的默认参数
Reason(原因)
That can cause confusion: An overrider does not inherit default arguments.
这可能会引起混乱:覆盖函数不会继承默认参数。
Example, bad(反面示例)
Enforcement(实施建议)
Flag default arguments on virtual functions if they differ between base and derived declarations.
如果基类和派生的虚函数和覆盖函数的默认参数不同,进行提示。
阅读更多更新文章,请关注微信公众号【面向对象思考】