From a84ed900d8f263fa734d6d5636824547656e5616 Mon Sep 17 00:00:00 2001 From: lingkerio whiher <112792583+lingkerio@users.noreply.github.com> Date: Sun, 7 May 2023 13:15:27 +0800 Subject: [PATCH 1/2] Update 02-usability.md --- book/zh-cn/02-usability.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/zh-cn/02-usability.md b/book/zh-cn/02-usability.md index d7193dd4..ed4fe982 100644 --- a/book/zh-cn/02-usability.md +++ b/book/zh-cn/02-usability.md @@ -880,7 +880,7 @@ C++11 引入了 `override` 和 `final` 这两个关键字来防止上述情形 #### override -当重载虚函数时,引入 `override` 关键字将显式的告知编译器进行重载,编译器将检查基函数是否存在这样的虚函数,否则将无法通过编译: +当重载虚函数时,引入 `override` 关键字将显式的告知编译器进行重载,编译器将检查基函数是否存在这样的其函数签名一致的虚函数,否则将无法通过编译: ```cpp struct Base { From e031ac0295460dfa72cf45db26256b6d785565ed Mon Sep 17 00:00:00 2001 From: lingkerio whiher <112792583+lingkerio@users.noreply.github.com> Date: Sun, 7 May 2023 13:18:24 +0800 Subject: [PATCH 2/2] Update 02-usability.md --- book/en-us/02-usability.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/en-us/02-usability.md b/book/en-us/02-usability.md index 3528c68a..6da7d8e5 100644 --- a/book/en-us/02-usability.md +++ b/book/en-us/02-usability.md @@ -971,7 +971,7 @@ C++11 introduces the two keywords `override` and `final` to prevent this from ha ### override -When overriding a virtual function, introducing the `override` keyword will explicitly tell the compiler to overload, and the compiler will check if the base function has such a virtual function, otherwise it will not compile: +When overriding a virtual function, introducing the `override` keyword will explicitly tell the compiler to overload, and the compiler will check if the base function has such a virtual function with consistent function signature, otherwise it will not compile: ```cpp struct Base {