mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-18 05:04:39 +03:00
book: discriminative modification to the nature of override and overload (#265)
This commit is contained in:
@@ -880,7 +880,7 @@ C++11 引入了 `override` 和 `final` 这两个关键字来防止上述情形
|
||||
|
||||
#### override
|
||||
|
||||
当重载虚函数时,引入 `override` 关键字将显式的告知编译器进行重载,编译器将检查基函数是否存在这样的虚函数,否则将无法通过编译:
|
||||
当重载虚函数时,引入 `override` 关键字将显式的告知编译器进行重载,编译器将检查基函数是否存在这样的其函数签名一致的虚函数,否则将无法通过编译:
|
||||
|
||||
```cpp
|
||||
struct Base {
|
||||
|
||||
Reference in New Issue
Block a user