From 32e43395678a4abd9d52ba84ad0e8d0c825119c6 Mon Sep 17 00:00:00 2001 From: Jacob Zhong Date: Wed, 4 Sep 2019 22:43:40 -0400 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: ouuan --- docs/lang/csl/container.md | 2 +- docs/lang/csl/iterator.md | 2 +- docs/lang/op.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/lang/csl/container.md b/docs/lang/csl/container.md index 366a7640..1b1bc816 100644 --- a/docs/lang/csl/container.md +++ b/docs/lang/csl/container.md @@ -17,7 +17,7 @@ - **映射** ( `map` ) 由 {键,值} 对组成的集合,以某种比较键大小关系的谓词进行排列。 - **多重映射** ( `multimap` ) 由 {键,值} 对组成的多重集合,亦即允许键有相等情况的映射。 -???+note 什么是谓词( [ **Predicate** ](https://en.wikipedia.org/wiki/Predicate_(mathematical_logic)) )? +???+note "什么是谓词 ( [ **Predicate** ](https://en.wikipedia.org/wiki/Predicate_(mathematical_logic)) )?" 谓词就是返回值为真或者假的函数。STL 容器中经常会使用到谓词,用于模板参数。 ### 无序(关联式)容器 diff --git a/docs/lang/csl/iterator.md b/docs/lang/csl/iterator.md index 2a5673bd..7db24bbd 100644 --- a/docs/lang/csl/iterator.md +++ b/docs/lang/csl/iterator.md @@ -8,7 +8,7 @@ ```cpp vector data(10); -for (int i = 0; i < 10; i++) cout << data[i] << endl; // 使用下标访问元素 +for (int i = 0; i < data.size(); i++) cout << data[i] << endl; // 使用下标访问元素 for (vector::iterator iter = data.begin(); iter != data.end(); iter++) cout << *iter << endl; // 使用迭代器访问元素 diff --git a/docs/lang/op.md b/docs/lang/op.md index ceaea998..70f32342 100644 --- a/docs/lang/op.md +++ b/docs/lang/op.md @@ -12,7 +12,7 @@ author: Ir1d, aofall | `+` (双目) | 加法 | | `-` (双目) | 减法 | -??? note“单目与双目运算符” +??? note "单目与双目运算符" 单目运算符(又称一元运算符)指被操作对象只有一个的运算符,而双目运算符(又称二元运算符)的被操作对象有两个。例如 `1+2` 中加号就是双目运算符,它有 `1` 和 `2` 两个被操作数。此外 C++ 中还有唯一的一个三目运算符 `?:` 。 算术运算符中有两个单目运算符(正、负)以及五个双目运算符(乘法、除法、取模、加法、减法),其中单目运算符的优先级最高。 -- 2.11.0