Skip to content

Commit 407148c

Browse files
committed
update: prepare C++20
1 parent 7204a23 commit 407148c

28 files changed

Lines changed: 66 additions & 67 deletions

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## 提交 Issue
66

7-
『C++ 11/14/17』的 issue 用于追踪书中存在的原则性的描述错误、存在的 `typo` 错误,以及向本书作者提问等。
7+
『C++ 11/14/17/20』的 issue 用于追踪书中存在的原则性的描述错误、存在的 `typo` 错误,以及向本书作者提问等。
88

99
- 通常情况下,你可能会发现书中某个段落存在错别字、语义错误、文法错误等。
1010
这都是 `typo` 错误。如果该错误已经对你的阅读造成了一定障碍,
@@ -24,7 +24,7 @@
2424

2525
## 提交 Pull request
2626

27-
『C++ 11/14/17』是一本开源书籍,任何人都可以参与贡献自己 PR。但在提交 PR 之前请仔细阅读下面的说明:
27+
『C++ 11/14/17/20』是一本开源书籍,任何人都可以参与贡献自己 PR。但在提交 PR 之前请仔细阅读下面的说明:
2828

2929
- 当你认为需要提交一个 PR 时,请确保 [issue 列表](https://github.com/changkun/modern-cpp-tutorial/issues)中,已经包含了你想要解决的问题。
3030
如果没有,请参考**提交 Issue** 一节中的描述,提交你的 issue,再提交你的 PR。

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 - Present Changkun Ou <hi@changkun.us>
3+
Copyright (c) 2016 - 2019 Changkun Ou <hi@changkun.us>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README-en-us.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
<img src="assets/cover-2nd-en.png" alt="logo" height="600" align="right" />
22

3-
# C++11/14/17 On the Fly
3+
# C++11/14/17/20 On the Fly
44

55
![](https://img.shields.io/badge/version-v2-green.svg) [![](https://img.shields.io/badge/language-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-red.svg)](./README.md) [![](https://img.shields.io/badge/language-English-blue.svg)](./README-en-us.md) [![](https://img.shields.io/badge/$-donate-ff69b4.svg)](./assets/donate.md) [![](https://img.shields.io/badge/chat-community-667ed5.svg)](./assets/community.md)
66

7-
8-
> This book is adapting to C++17 and translating to English.
9-
107
## Purpose
118

129
The book claims "On the Fly". Its intent is to provide a comprehensive introduction to the relevant features regarding modern C++ (before 2020s).
@@ -15,7 +12,7 @@ Readers should aware that all of these features are not required. It should be l
1512

1613
At the same time, instead of grammar-only, the book introduces the historical background as simple as possible of its technical requirements, which provides great help in understanding why these features comes out.
1714

18-
In addition, The author would like to encourage that readers should be able to use C++17 directly in their new projects and migrate their old projects to C++17 gradually after read the book.
15+
In addition, The author would like to encourage that readers should be able to use modern C++ directly in their new projects and migrate their old projects to modern C++ gradually after read the book.
1916

2017
## Targets
2118

@@ -51,4 +48,4 @@ The author has limited time and language skills. If readers find any mistakes of
5148

5249
## Licenses
5350

54-
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work is written by [Ou Changkun](https://changkun.de) and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>. The code of this repository is open sourced under the [MIT license](./LICENSE).
51+
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work was written by [Ou Changkun](https://changkun.de) and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>. The code of this repository is open sourced under the [MIT license](./LICENSE).

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<img src="assets/cover-2nd.png" alt="logo" height="600" align="right" />
1+
<img src="assets/cover-2nd.png" alt="logo" height="550" align="right" />
22

3-
# 《高速上手 C++11/14/17》
3+
# 《高速上手 C++11/14/17/20
44

55
[![](https://img.shields.io/badge/language-%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87-red.svg)](./README.md) [![](https://img.shields.io/badge/language-English-blue.svg)](./README-en-us.md)
66
[![](https://img.shields.io/badge/%C2%A5-%E8%B5%9E%E5%8A%A9-ff69b4.svg)](./assets/donate.md)
@@ -11,7 +11,7 @@
1111

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

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

1616
## 目标读者
1717

assets/cover-2nd-en.afphoto

10 KB
Binary file not shown.

assets/cover-2nd-en.png

12.4 KB
Loading

assets/cover-2nd.afphoto

2.38 MB
Binary file not shown.

assets/cover-2nd.png

93.8 KB
Loading

book/en-us/00-preface.md

Whitespace-only changes.

book/en-us/toc.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# C++ 11/14/17 On The Fly
1+
# C++ 11/14/17/20 On The Fly
22

33
## Table of Contents
44

55
- [**Preface**](./00-preface.md)
6-
- [**Chapter 01 Towards C++11/14/17**](./01-intro.md)
6+
- [**Chapter 01 Towards Modern C++**](./01-intro.md)
77
+ 1.1 Deprecated Features
88
+ 1.2 Compatibility with C
99
+ Further Readings
@@ -39,69 +39,71 @@
3939
- Explicit delete default function
4040
- Strongly typed enumerations
4141
- [**Chapter 03 Language Runtime Enhancements**](./03-runtime.md)
42-
+ Lambda expression
42+
+ 3.1 Lambda expression
4343
+ Basics
4444
+ Value capture
4545
+ Reference capture
4646
+ Implicit capture
4747
+ Expression capture
4848
+ Generic lambda
49-
+ Function object wrapper
49+
+ 3.2 Function object wrapper
5050
+ std::function
5151
+ std::bind/std::placeholder
52-
+ rvalue reference
52+
+ 3.3 rvalue reference
5353
+ lvalue, rvalue, prvalue, xvalue
5454
+ rvalue reference & lvalue reference
5555
+ Move semantics
5656
+ Perfect forwarding
5757
- [**Chapter 04 Sandard Library: Containers**](./04-containers.md)
58-
+ `std::array`
59-
+ `std::forward_list`
60-
+ `std::unordered_set`
61-
+ `std::unordered_map`
62-
+ `std::tuple`
58+
+ 4.1 `std::array` and `std::forward_list`
59+
+ 4.2 Unordered containers
60+
+ `std::unordered_set`
61+
+ `std::unordered_map`
62+
+ 4.3 Tuples `std::tuple`
6363
+ basic operation
6464
+ runtime indexing
6565
+ merge and iteration
6666
- [**Chapter 05 Sandard Library: Pointers**](./05-pointers.md)
67-
+ RAII and reference counting
68-
+ `std::shared_ptr`
69-
+ `std::unique_ptr`
70-
+ `std::weak_ptr`
67+
+ 5.1 RAII and reference counting
68+
+ 5.2 `std::shared_ptr`
69+
+ 5.3 `std::unique_ptr`
7170
- [**Chapter 06 Sandard Library: Regular Expression**](./06-regex.md)
72-
+ Regular Expression Introduction
71+
+ 6.1 Regular Expression Introduction
7372
+ Normal characters
7473
+ Special characters
7574
+ Determinative
76-
+ `std::regex`
75+
+ 6.2 `std::regex` and related
7776
+ `std::regex`
7877
+ `std::regex_match`
7978
+ `std::match_results`
8079
- [**Chapter 07 Sandard Library: Threads and Concurrency**](./07-thread.md)
81-
+ `std::thread`
82-
+ `std::mutex`
83-
+ `std::unique_lock`
84-
+ `std::future`
85-
+ `std::packaged_task`
86-
+ `std::condition_variable`
80+
+ 7.1 `std::thread`
81+
+ 7.2 `std::mutex` and `std::unique_lock`
82+
+ 7.3 `std::future` and `std::packaged_task`
83+
+ 7.4 `std::condition_variable`
84+
+ 7.5 `std::atomic` and memory order
85+
+ 7.6 Transactional memory
8786
- [**Chapter 08 Sandard Library: File System**](./08-filesystem.md)
87+
+ 8.1 Documents and links
88+
+ 8.2 `std::filesystem`
8889
- [**Chapter 09 Minor Features**](./09-others.md)
89-
+ New Types
90+
+ 9.1 New Types
9091
+ `long long int`
91-
+ `noexcept`
92-
+ Literal
92+
+ 9.2 `noexcept` and its operates
93+
+ 9.3 Literal
9394
+ Raw string literal
9495
+ Custom string literal
95-
+ Math Library
96+
+ 9.4 Math Library
9697
- [**Chapter 10 Outlook: Introduction of C++20**](./10-cpp20.md)
9798
+ Concept
9899
+ Range
99100
+ Module
100101
+ Coroutine
101-
- [**Appendix: Further Study Materials**](./appendix.md)
102+
- [**Appendix 1: Further Study Materials**](./appendix1.md)
103+
- [**Appendix 2: Modern C++ Best Practices**](./appendix2.md)
102104

103105
Table of Content | Last Chapter | [Next Chapter: Preface](./00-preface.md)
104106

105107
## Licenses
106108

107-
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work is written by [Ou Changkun](https://changkun.de) and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>. The code of this repository is open sourced under the [MIT license](./LICENSE).
109+
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png" /></a><br />This work was written by [Ou Changkun](https://changkun.de) and licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/">Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License</a>. The code of this repository is open sourced under the [MIT license](./LICENSE).

0 commit comments

Comments
 (0)