Skip to content

Commit

Permalink
fix various typo
Browse files Browse the repository at this point in the history
  • Loading branch information
y1yang0 committed Mar 8, 2022
1 parent 3f18cac commit 2c034e9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
2 changes: 1 addition & 1 deletion 1.DeducingTypes/item4.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const std::_Simple_types<...>::value_type *const &
````
这个比起`T`来说要简单一些,但是如果你不知道“`...`”表示编译器忽略`T`的部分类型那么可能你还是会产生困惑。如果你运气好点你的IDE可能表现得比这个要好一些。

比起运气如果你更倾向于依赖库,那么你乐意被告知`std::type_info::name`和IDE不怎么好,Boost TypeIndex库(通常写作**Boost.TypeIndex**)是更好的选择。这个库不是标准C++的一部分,也不是IDE或者`TD`这样的模板。Boost库(可在[boost.com](http://boost.com)获得)是跨平台,开源,有良好的开源协议的库,这意味着使用Boost和STL一样具有高度可移植性。
比起运气如果你更倾向于依赖库,那么你乐意被告知`std::type_info::name`和IDE不怎么好,Boost TypeIndex库(通常写作**Boost.TypeIndex**)是更好的选择。这个库不是标准C++的一部分,也不是IDE或者`TD`这样的模板。Boost库(可在[boost.com](http://boost.org)获得)是跨平台,开源,有良好的开源协议的库,这意味着使用Boost和STL一样具有高度可移植性。

这里是如何使用Boost.TypeIndex得到`f`的类型的代码
````cpp
Expand Down
2 changes: 1 addition & 1 deletion 3.MovingToModernCpp/item7.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Widget w3(10, 5.0); //使用小括号初始化,同之前一样

Widget w4{10, 5.0}; //使用花括号初始化,但是现在
//调用std::initializer_list版本构造函数
//(10 和 true 转化为long double)
//(10 和 5.0 转化为long double)
````
甚至普通的构造函数和移动构造函数都会被`std::initializer_list`构造函数劫持:
````cpp
Expand Down
2 changes: 1 addition & 1 deletion 6.LambdaExpressions/item34.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ auto setSoundB =

如果此时*lambda*看起来还没有吸引力,那么应该检查一下视力了。

`setAlarm`重载时,会出现一个新问题。 假设有一个重载函数,其中第四个形参了音量
`setAlarm`重载时,会出现一个新问题。 假设有一个重载函数,其中第四个形参指定了音量

```c++
enum class Volume { Normal, Loud, LoudPlusPlus };
Expand Down

0 comments on commit 2c034e9

Please sign in to comment.