Skip to content

Commit

Permalink
Fix: 修复文字错误
Browse files Browse the repository at this point in the history
  • Loading branch information
czs108 committed Dec 26, 2021
1 parent 68a7d92 commit 53be2aa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Chapter-10 Generic Algorithms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,12 +302,12 @@ for_each(words.begin(), words.end(), bind(print, ref(os), _1, ' '));
- `inserter`:创建一个调用`insert`操作的迭代器。此函数接受第二个参数,该参数必须是一个指向给定容器的迭代器,元素会被插入到该参数指向的元素之前。

```c++
list<int> 1st = { 1,2,3,4 };
list<int> lst = { 1,2,3,4 };
list<int> lst2, lst3; // empty lists
// after copy completes, 1st2 contains 4 3 2 1
copy(1st.cbegin(), lst.cend(), front_inserter(lst2));
// after copy completes, 1st3 contains 1 2 3 4
copy(1st.cbegin(), lst.cend(), inserter(lst3, lst3.begin()));
// after copy completes, lst2 contains 4 3 2 1
copy(lst.cbegin(), lst.cend(), front_inserter(lst2));
// after copy completes, lst3 contains 1 2 3 4
copy(lst.cbegin(), lst.cend(), inserter(lst3, lst3.begin()));
```

### iostream迭代器(iostream Iterators)
Expand Down
3 changes: 1 addition & 2 deletions Chapter-13 Copy Control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ Sales_data& Sales_data::operator=(const Sales_data &rhs)
{
bookNo = rhs.bookNo; // calls the string::operator=
units_sold = rhs.units_sold; // uses the built-in int assignment
revenue = rhs.revenue; // uses the built-in double
assignment
revenue = rhs.revenue; // uses the built-in double assignment
return *this; // return a reference to this object
}
```
Expand Down
2 changes: 1 addition & 1 deletion Chapter-16 Templates and Generic Programming/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ s2 = std::move(s1); // ok: but after the assigment s1 has indeterminate valu
- `remove_reference`用`string&`进行实例化。
- `remove_reference<string&>`的`type`成员是`string`。
- `move`的返回类型是`string&&`。
- `move`的函数参数t的类型为`string& &&`,会折叠成`string&`。
- `move`的函数参数*t*的类型为`string& &&`,会折叠成`string&`。

可以使用`static_cast`显式地将一个左值转换为一个右值引用。

Expand Down
2 changes: 1 addition & 1 deletion Chapter-19 Specialized Tools and Techniques/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ dynamic_cast<type&&>(e)
通常情况下,`typeid`用于比较两条表达式的类型是否相同,或者比较一条表达式的类型是否与指定类型相同。

```c++
C++Derived *dp = new Derived;
Derived *dp = new Derived;
Base *bp = dp; // both pointers point to a Derived object
// compare the type of two objects at run time
if (typeid(*bp) == typeid(*dp))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@

## 关于

***GitHub***:https://github.com/czs108/
***GitHub***:https://github.com/czs108

***E-Mail***:[email protected]

0 comments on commit 53be2aa

Please sign in to comment.