From 32bdf85ebd1dc885870250266d2627a90f04b3f7 Mon Sep 17 00:00:00 2001
From: changdingfang <245292011@qq.com>
Date: Mon, 24 Aug 2020 12:59:44 +0800
Subject: [PATCH] book: fix indent typos (#117)
---
book/en-us/07-thread.md | 4 +++-
book/zh-cn/04-containers.md | 14 +++++++-------
book/zh-cn/07-thread.md | 2 ++
3 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/book/en-us/07-thread.md b/book/en-us/07-thread.md
index 4ee9160..a2032d1 100644
--- a/book/en-us/07-thread.md
+++ b/book/en-us/07-thread.md
@@ -314,6 +314,8 @@ struct A {
int y;
long long z;
};
+
+int main() {
std::atomic a;
std::cout << std::boolalpha << a.is_lock_free() << std::endl;
return 0;
@@ -546,4 +548,4 @@ They provide an critical foundation for standardized high performance computing
## Licenses
-
This work was written by [Ou Changkun](https://changkun.de) and licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. The code of this repository is open sourced under the [MIT license](../../LICENSE).`
\ No newline at end of file
+
This work was written by [Ou Changkun](https://changkun.de) and licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. The code of this repository is open sourced under the [MIT license](../../LICENSE).`
diff --git a/book/zh-cn/04-containers.md b/book/zh-cn/04-containers.md
index 219676b..a9999a6 100644
--- a/book/zh-cn/04-containers.md
+++ b/book/zh-cn/04-containers.md
@@ -186,14 +186,14 @@ Key:[3] Value:[3]
auto get_student(int id)
{
-// 返回类型被推断为 std::tuple
+ // 返回类型被推断为 std::tuple
-if (id == 0)
- return std::make_tuple(3.8, 'A', "张三");
-if (id == 1)
- return std::make_tuple(2.9, 'C', "李四");
-if (id == 2)
- return std::make_tuple(1.7, 'D', "王五");
+ if (id == 0)
+ return std::make_tuple(3.8, 'A', "张三");
+ if (id == 1)
+ return std::make_tuple(2.9, 'C', "李四");
+ if (id == 2)
+ return std::make_tuple(1.7, 'D', "王五");
return std::make_tuple(0.0, 'D', "null");
// 如果只写 0 会出现推断错误, 编译失败
}
diff --git a/book/zh-cn/07-thread.md b/book/zh-cn/07-thread.md
index 9dd58ae..b02daa0 100644
--- a/book/zh-cn/07-thread.md
+++ b/book/zh-cn/07-thread.md
@@ -321,6 +321,8 @@ struct A {
int y;
long long z;
};
+
+int main() {
std::atomic a;
std::cout << std::boolalpha << a.is_lock_free() << std::endl;
return 0;