Skip to content

Commit 07badc8

Browse files
baixiangcppchangkun
authored andcommitted
fix: indent (changkun#61)
1 parent 818a848 commit 07badc8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

book/zh-cn/02-usability.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -824,8 +824,8 @@ int main() {
824824
```cpp
825825
struct Base {
826826
virtual void foo();
827-
};
828-
struct SubClass: Base {
827+
};
828+
struct SubClass: Base {
829829
void foo();
830830
};
831831
```
@@ -840,11 +840,11 @@ C++11 引入了 `override` 和 `final` 这两个关键字来防止上述情形
840840

841841
```cpp
842842
struct Base {
843-
virtual void foo(int);
843+
virtual void foo(int);
844844
};
845845
struct SubClass: Base {
846-
virtual void foo(int) override; // 合法
847-
virtual void foo(float) override; // 非法, 父类没有此虚函数
846+
virtual void foo(int) override; // 合法
847+
virtual void foo(float) override; // 非法, 父类没有此虚函数
848848
};
849849
```
850850
@@ -854,7 +854,7 @@ virtual void foo(float) override; // 非法, 父类没有此虚函数
854854
855855
```cpp
856856
struct Base {
857-
virtual void foo() final;
857+
virtual void foo() final;
858858
};
859859
struct SubClass1 final: Base {
860860
}; // 合法
@@ -863,7 +863,7 @@ struct SubClass2 : SubClass1 {
863863
}; // 非法, SubClass1 已 final
864864
865865
struct SubClass3: Base {
866-
void foo(); // 非法, foo 已 final
866+
void foo(); // 非法, foo 已 final
867867
};
868868
```
869869

0 commit comments

Comments
 (0)