docs(cpp11/02): add final and override chapter (zh + en)#45
Merged
Conversation
Adds the missing tutorial doc for chapter 02 in both languages, mirroring the structure of existing chapters (00, 11): resource table, Why / Difference Q&A, "I. Basic Usage", "II. Important Notes", "III. Practice Code", "IV. Additional Resources" footer. Covers override for explicit overriding, final on virtual functions and on classes, the final + pure virtual NVI pattern (matching the AudioPlayer/WAV/MP3/OGG exercise), and context-sensitive identifier semantics. SUMMARY.md updated in both zh and en to insert the new entry between 01 and 09.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
补齐 cpp11 第 2 章 `final 和 override` 的中英文文档(之前两边都缺)。
风格 / 结构对齐已有章节(参照 ch00 auto-and-decltype 和 ch11 inherited-constructors):
内容覆盖:override 显式重写 + 编译期校验、final 修饰虚函数和类的两种用法、final + 纯虚的 NVI 模板方法(直接对应 02-2 的 AudioPlayer/WAV/MP3/OGG 练习)、上下文相关标识符(解释为什么 dslings 里能用 `B override;` / `B final;` 当变量名)、override 必须配合 virtual、final 类慎用、final 不能用在非虚函数、override + final 可叠加。
视频单元格留空 (`视频解读` / `Video Explanation`),沿用 12-nullptr / 13-long-long 的"暂未录制"约定。
Test plan