使用更合适的翻译

This commit is contained in:
Yi Yang 2022-03-08 19:11:03 +08:00
parent a534a8c8a1
commit 69501f75e3
2 changed files with 2 additions and 2 deletions

View File

@ -213,8 +213,7 @@ constexpr auto
```cpp ```cpp
auto val = std::get<toUType(UserInfoFields::uiEmail)>(uInfo); auto val = std::get<toUType(UserInfoFields::uiEmail)>(uInfo);
``` ```
这仍然比使用非限域`enum`要写更多的代码,但同时它也避免命名空间污染,防止不经意间使用隐式转换。在大多情况下,你可能会认为多输入一些字符是一个合理的代价, 这仍然比使用非限域`enum`要写更多的代码但同时它也避免命名空间污染防止不经意间使用隐式转换。大多数情况下你应该会觉得多敲几个几行字符作为避免使用未限域枚举这种老得和2400波特率猫同时代技术的代价是值得的。
用来避免这种可以追溯到数字电信领域最先的进技术是2400波特调制解调器的远古时代的枚举技术缺陷。
**记住** **记住**
+ C++98的`enum`即非限域`enum`。 + C++98的`enum`即非限域`enum`。

View File

@ -13,6 +13,7 @@
> ! [PDF格式英文版下载](0.Public/EffectiveModernCpp.pdf),仅供翻译参考<br> > ! [PDF格式英文版下载](0.Public/EffectiveModernCpp.pdf),仅供翻译参考<br>
## 目录 ## 目录
0. [__简介__](Introduction.md)
1. __类型推导__ 1. __类型推导__
1. [Item 1:理解模板类型推导](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item1.md) 已修订 1. [Item 1:理解模板类型推导](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item1.md) 已修订
2. [Item 2:理解auto类型推导](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item2.md) 2. [Item 2:理解auto类型推导](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item2.md)