Skip to content

Commit 6ba0b45

Browse files
committed
book: add 'How to read this book' section to the preface
Add reading guidance for readers who already know some C++11 (e.g. university students): state prerequisites, point to the per-feature 'since' markers and the appendix 3 feature index, describe the three-part structure, and encourage reading-by-need. Also refresh stale wording ('before the 2020s' -> C++11 to C++26; migrate to modern C++, not C++17).
1 parent 22caa92 commit 6ba0b45

2 files changed

Lines changed: 27 additions & 3 deletions

File tree

book/en-us/00-preface.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,21 @@ In conclusion, as an advocate and practitioner of C++, we always maintain an ope
2727

2828
- This book introduces to a certain extent of the dark magic of modern C++. However, these magics are very limited, they are not suitable for readers who want to learn advanced C++. The purpose of this book is to offer a quick start for modern C++. Of course, advanced readers can also use this book to review and examine themselves on modern C++.
2929

30+
## How to read this book
31+
32+
Modern C++ is large, and you do not need to read every page in order. This book assumes you are already comfortable with the basics of C++ — roughly the C++11-era language: classes, templates, and the common standard-library containers. If that describes you (for example, you learned some C++ at university), feel free to skim the parts you already know and focus on what is new to you.
33+
34+
Several aids are built in to help you navigate:
35+
36+
- Each feature is marked with the standard that introduced it (for example, *(since C++17)*), so you can tell at a glance what is newer than the C++ you already know.
37+
- [Appendix 3](./appendix3.md) is a feature index that maps each feature to the chapter where it appears and the standard it came from — handy for jumping straight to "what's new in C++20", or for looking a feature up later.
38+
- The book is organized in three parts: the **language core** (Chapters 1–3), the **standard library** (Chapters 4–9), and a **tour by standard version** (Chapters 10–12, covering C++20, C++23, and the forthcoming C++26).
39+
40+
Rather than trying to memorize every feature, treat this book as a reference you return to: reach for a feature when a real problem calls for it.
41+
3042
## Purpose
3143

32-
The book claims "On the Fly". It intends to provide a comprehensive introduction to the relevant features regarding modern C++ (before the 2020s).
44+
The book claims "On the Fly". It intends to provide a comprehensive introduction to the relevant features of modern C++, from C++11 all the way to C++26.
3345
Readers can choose interesting content according to the following table of contents to learn and quickly familiarize themselves with the new features that are available.
3446
Readers should aware that all of these features are not required. It should be learned when you need it.
3547

book/zh-cn/00-preface.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,25 @@ C++17 则是近三年依赖 C++ 社区一致推进的方向,也指出了 **现
2626
1. 本书假定读者已经熟悉了传统 C++ ,至少在阅读传统 C++ 代码上不具备任何困难。换句话说,那些长期使用传统 C++ 进行编码的人、渴望在短时间内迅速了解**现代 C++** 特性的人非常适合阅读本书;
2727
2. 本书一定程度上介绍了一些现代 C++ 的**黑魔法**,但这些魔法毕竟有限,不适合希望进阶学习现代 C++ 的读者,本书的定位系**现代 C++ 的快速上手**。当然,希望进阶学习的读者可以使用本书来回顾并检验自己对 **现代 C++** 的熟悉度。
2828

29+
## 如何阅读本书
30+
31+
现代 C++ 的内容十分庞大,你并不需要从头到尾逐页阅读。本书假定你已经熟悉 C++ 的基础——大致相当于 C++11 时期的语言:类、模板,以及常用的标准库容器等。如果你正属于这种情况(比如在大学里学过一些 C++),完全可以跳过你已经熟悉的部分,把精力集中在对你而言全新的内容上。
32+
33+
为方便你查阅,本书内置了几处导航辅助:
34+
35+
- 每个特性都标注了引入它的标准版本(例如 *(C++17 引入)*),让你一眼就能看出哪些内容比你已知的 C++ 更新。
36+
- [附录 3](./appendix3.md) 是一份特性索引,将每个特性映射到它所在的章节以及引入它的标准版本——便于你直接跳到「C++20 新增了什么」,或日后查阅某个特性。
37+
- 全书分为三个部分:**语言核心**(第 1–3 章)、**标准库**(第 4–9 章),以及**按标准版本概览**(第 10–12 章,分别介绍 C++20、C++23 与即将到来的 C++26)。
38+
39+
与其试图记住每一个特性,不如把本书当作一本可以随时回查的参考书:当真实的问题需要某个特性时,再去学习它。
40+
2941
## 本书目的
3042

31-
本书号称『高速上手』,从内容上对二十一世纪二十年代之前产生 C++ 的相关特性做了非常相对全面的介绍,读者可以自行根据下面的目录选取感兴趣的内容进行学习,快速熟悉需要了解的内容。这些特性并不需要全部掌握,只需针对自己的使用需求和特定的应用场景,学习、查阅最适合自己的新特性即可。
43+
本书号称『高速上手』,从内容上对从 C++11 一直到 C++26 的相关特性做了相对全面的介绍,读者可以自行根据下面的目录选取感兴趣的内容进行学习,快速熟悉需要了解的内容。这些特性并不需要全部掌握,只需针对自己的使用需求和特定的应用场景,学习、查阅最适合自己的新特性即可。
3244

3345
同时,本书在介绍这些特性的过程中,尽可能简单明了的介绍了这些特性产生的历史背景和技术需求,这为理解这些特性、运用这些特性提供了很大的帮助。
3446

35-
此外,笔者希望读者在阅读本书后,能够努力在新项目中直接使用 C++17,并努力将旧项目逐步迁移到 C++17。也算是笔者为推进现代 C++ 的普及贡献了一些绵薄之力。
47+
此外,笔者希望读者在阅读本书后,能够努力在新项目中直接使用现代 C++,并努力将旧项目逐步迁移到现代 C++。也算是笔者为推进现代 C++ 的普及贡献了一些绵薄之力。
3648

3749
## 相关代码
3850

0 commit comments

Comments
 (0)