Skip to content

Commit 86d84d2

Browse files
committed
book: chapter name refinement
1 parent 115827f commit 86d84d2

File tree

7 files changed

+21
-27
lines changed

7 files changed

+21
-27
lines changed

book/en-us/03-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ order: 3
66

77
# Chapter 03: Language Runtime Enhancements
88

9-
[Table of Content](./toc.md) | [Previous Chapter](./02-usability.md) | [Next Chapter: Standard Library: Containers](./04-containers.md)
9+
[Table of Content](./toc.md) | [Previous Chapter](./02-usability.md) | [Next Chapter: Containers](./04-containers.md)
1010

1111
## Further Readings
1212

book/en-us/04-containers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
title: "Chapter 04 Standard Library: Containers"
2+
title: "Chapter 04 Containers"
33
type: book-en-us
44
order: 4
55
---
66

7-
# Chapter 04 Standard Library: Containers
7+
# Chapter 04 Containers
88

9-
[Table of Content](./toc.md) | [Previous Chapter](./03-runtime.md) | [Next Chapter: Standard Library: Pointers](./05-pointers.md)
9+
[Table of Content](./toc.md) | [Previous Chapter](./03-runtime.md) | [Next Chapter: Smart Pointers and Memory Management](./05-pointers.md)
1010

1111
## Further Readings
1212

book/en-us/05-pointers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: "Chapter 05 Standard Library: Pointers"
2+
title: "Chapter 05 Smart Pointers and Memory Management"
33
type: book-en-us
44
order: 5
55
---
66

7-
# Chapter 05 Standard Library: Pointers
7+
# Chapter 05 Smart Pointers and Memory Management
88

99
[Table of Content](./toc.md) | [Previous Chapter](./04-containers.md) | [Next Chapter: Regular Expression](./06-regex.md)
1010

book/en-us/toc.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
+ rvalue reference & lvalue reference
5656
+ Move semantics
5757
+ Perfect forwarding
58-
- [**Chapter 04 Standard Library: Containers**](./04-containers.md)
58+
- [**Chapter 04 Containers**](./04-containers.md)
5959
+ 4.1 `std::array` and `std::forward_list`
6060
+ 4.2 Unordered containers
6161
+ `std::unordered_set`
@@ -64,11 +64,11 @@
6464
+ basic operation
6565
+ runtime indexing
6666
+ merge and iteration
67-
- [**Chapter 05 Standard Library: Pointers**](./05-pointers.md)
67+
- [**Chapter 05 Smart Pointers and Memory Management**](./05-pointers.md)
6868
+ 5.1 RAII and reference counting
6969
+ 5.2 `std::shared_ptr`
7070
+ 5.3 `std::unique_ptr`
71-
- [**Chapter 06 Standard Library: Regular Expression**](./06-regex.md)
71+
- [**Chapter 06 Regular Expression**](./06-regex.md)
7272
+ 6.1 Introduction
7373
+ Ordinary characters
7474
+ Special characters

book/zh-cn/03-runtime.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ order: 3
66

77
# 第 3 章 语言运行期的强化
88

9-
> 内容修订中
10-
119
[TOC]
1210

1311
## 3.1 Lambda 表达式
@@ -73,7 +71,7 @@ void learn_lambda_func_2() {
7371
* \[&\] 引用捕获, 让编译器自行推导捕获列表
7472
* \[=\] 值捕获, 让编译器执行推导应用列表
7573

76-
**4. 表达式捕获\(C++14\)**
74+
**4. 表达式捕获**
7775

7876
> 这部分内容需要了解后面马上要提到的右值引用以及智能指针
7977
@@ -189,15 +187,15 @@ int main() {
189187

190188
要弄明白右值引用到底是怎么一回事,必须要对左值和右值做一个明确的理解。
191189

192-
**左值\(lvalue, left value\)**,顾名思义就是赋值符号左边的值。准确来说,左值是表达式(不一定是赋值表达式)后依然存在的持久对象。
190+
**左值(lvalue, left value)**,顾名思义就是赋值符号左边的值。准确来说,左值是表达式(不一定是赋值表达式)后依然存在的持久对象。
193191

194-
**右值\(rvalue, right value\)**,右边的值,是指表达式结束后就不再存在的临时对象。
192+
**右值(rvalue, right value)**,右边的值,是指表达式结束后就不再存在的临时对象。
195193

196194
而 C++11 中为了引入强大的右值引用,将右值的概念进行了进一步的划分,分为:纯右值、将亡值。
197195

198-
**纯右值\(prvalue, pure rvalue\)**,纯粹的右值,要么是纯粹的字面量,例如 `10`, `true`;要么是求值结果相当于字面量或匿名临时对象,例如 `1+2`。非引用返回的临时变量、运算表达式产生的临时变量、原始字面量、Lambda 表达式都属于纯右值。
196+
**纯右值(prvalue, pure rvalue)**,纯粹的右值,要么是纯粹的字面量,例如 `10`, `true`;要么是求值结果相当于字面量或匿名临时对象,例如 `1+2`。非引用返回的临时变量、运算表达式产生的临时变量、原始字面量、Lambda 表达式都属于纯右值。
199197

200-
**将亡值\(xvalue, expiring value\)**,是 C++11 为了引入右值引用而提出的概念(因此在传统 C++中,纯右值和右值是同一个概念),也就是即将被销毁、却能够被移动的值。
198+
**将亡值(xvalue, expiring value)**,是 C++11 为了引入右值引用而提出的概念(因此在传统 C++中,纯右值和右值是同一个概念),也就是即将被销毁、却能够被移动的值。
201199

202200
将亡值可能稍有些难以理解,我们来看这样的代码:
203201

@@ -418,7 +416,7 @@ std::forward 传参:左值引用
418416

419417
无论传递参数为左值还是右值,普通传参都会将参数作为左值进行转发,所以 `std::move` 总会接受到一个左值,从而转发调用了`reference(int&&)` 输出右值引用。
420418

421-
唯独 `std::forward` 即没有造成任何多余的拷贝,同时**完美转发**\(传递\)了函数的实参给了内部调用的其他函数。
419+
唯独 `std::forward` 即没有造成任何多余的拷贝,同时**完美转发**(传递)了函数的实参给了内部调用的其他函数。
422420

423421
> `std::forward``std::move` 一样,没有做任何事情,`std::move` 单纯的将左值转化为右值,`std::forward` 也只是单纯的将参数做了一个类型的转换,从现象上来看,`std::forward<T>(v)``static_cast<T&&>(v)` 是完全一样的。
424422
@@ -430,7 +428,7 @@ std::forward 传参:左值引用
430428
2. 函数对象容器 std::function
431429
3. 右值引用
432430

433-
[返回目录](./toc.md) | [上一章](./02-usability.md) | [下一章 标准库:容器](./04-containers.md)
431+
[返回目录](./toc.md) | [上一章](./02-usability.md) | [下一章 容器](./04-containers.md)
434432

435433
## 许可
436434

book/zh-cn/04-containers.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
2-
title: 第 4 章 标准库:容器
2+
title: 第 4 章 容器
33
type: book-zh-cn
44
order: 4
55
---
66

7-
# 第 4 章 标准库:容器
8-
9-
> 内容修订中
7+
# 第 4 章 容器
108

119
[TOC]
1210

@@ -303,7 +301,7 @@ for(int i = 0; i != tuple_len(new_tuple); ++i)
303301

304302
`std::tuple` 虽然有效,但是标准库提供的功能有限,没办法满足运行期索引和迭代的需求,好在我们还有其他的方法可以自行实现。
305303

306-
[返回目录](./toc.md) | [上一章](./03-runtime.md) | [下一章 标准库:指针](./05-pointers.md)
304+
[返回目录](./toc.md) | [上一章](./03-runtime.md) | [下一章 智能指针与内存管理](./05-pointers.md)
307305

308306
## 许可
309307

book/zh-cn/05-pointers.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
---
2-
title: 第 5 章 标准库:指针
2+
title: 第 5 章 智能指针与内存管理
33
type: book-zh-cn
44
order: 5
55
---
66

7-
# 第 5 章 标准库:指针
8-
9-
> 内容修订中
7+
# 第 5 章 智能指针与内存管理
108

119
[TOC]
1210

0 commit comments

Comments
 (0)