Skip to content

Commit 32bdf85

Browse files
book: fix indent typos (changkun#117)
1 parent 4de9eb4 commit 32bdf85

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

book/en-us/07-thread.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ struct A {
314314
int y;
315315
long long z;
316316
};
317+
318+
int main() {
317319
std::atomic<A> a;
318320
std::cout << std::boolalpha << a.is_lock_free() << std::endl;
319321
return 0;
@@ -546,4 +548,4 @@ They provide an critical foundation for standardized high performance computing
546548
547549
## Licenses
548550
549-
<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).`
551+
<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).`

book/zh-cn/04-containers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ Key:[3] Value:[3]
186186

187187
auto get_student(int id)
188188
{
189-
// 返回类型被推断为 std::tuple<double, char, std::string>
190-
191-
if (id == 0)
192-
return std::make_tuple(3.8, 'A', "张三");
193-
if (id == 1)
194-
return std::make_tuple(2.9, 'C', "李四");
195-
if (id == 2)
196-
return std::make_tuple(1.7, 'D', "王五");
189+
// 返回类型被推断为 std::tuple<double, char, std::string>
190+
191+
if (id == 0)
192+
return std::make_tuple(3.8, 'A', "张三");
193+
if (id == 1)
194+
return std::make_tuple(2.9, 'C', "李四");
195+
if (id == 2)
196+
return std::make_tuple(1.7, 'D', "王五");
197197
return std::make_tuple(0.0, 'D', "null");
198198
// 如果只写 0 会出现推断错误, 编译失败
199199
}

book/zh-cn/07-thread.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,8 @@ struct A {
321321
int y;
322322
long long z;
323323
};
324+
325+
int main() {
324326
std::atomic<A> a;
325327
std::cout << std::boolalpha << a.is_lock_free() << std::endl;
326328
return 0;

0 commit comments

Comments
 (0)