调整文件夹名称和结构

This commit is contained in:
qingfeng.yy 2021-01-21 11:24:36 +08:00
parent 4789409036
commit 5a1c0cd8a1
70 changed files with 26 additions and 26 deletions

View File

Before

Width:  |  Height:  |  Size: 288 KiB

After

Width:  |  Height:  |  Size: 288 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -47,7 +47,7 @@ std::vector<std::shared_ptr<Widget>> vpw{ pw1, pw2 };
它不能。它必须使用更多的内存。然而,那部分内存不是`std::shared_ptr`对象的一部分。那部分在堆上面,只要`std::shared_ptr`自定义了分配器,那部分内存随便在哪都行。我前面提到了`std::shared_ptr`对象包含了所指对象的引用计数。没错,但是有点误导人。因为引用计数是另一个更大的数据结构的一部分,那个数据结构通常叫做**控制块**control block。控制块包含除了引用计数值外的一个自定义销毁器的拷贝当然前提是存在自定义销毁器。如果用户还指定了自定义分配器控制器也会包含一个分配器的拷贝。控制块可能还包含一些额外的数据正如Item21提到的一个次级引用计数weak count但是目前我们先忽略它。我们可以想象`std::shared_ptr`对象在内存中是这样:
![](../x.public/item19_1.png)
![](../0.Public/item19_1.png)
当`std::shared_ptr`对象一创建,对象控制块就建立了。至少我们期望是如此。通常,对于一个创建指向对象的`std::shared_ptr`的函数来说不可能知道是否有其他`std::shared_ptr`早已指向那个对象,所以控制块的创建会遵循下面几条规则:

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -1,6 +1,6 @@
# 《Effective Modern C++ 》翻译
<img src="https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/x.public/1.png?raw=true" align="right" weight="300" height="400"/>
<img src="https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/0.Public/1.png?raw=true" align="right" weight="300" height="400"/>
[![Backers on Open Collective](https://opencollective.com/EffectiveModernCppChinese/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/EffectiveModernCppChinese/sponsors/badge.svg)](#sponsors)
@ -10,7 +10,7 @@
> ! 我没有版权,我没有版权,我没有版权<br>
> 本书要求读者具有C++基础<br>
> !未翻译的条款名称现在直译,翻译时可能适当修改<br>
> ! [PDF格式英文版下载](x.public/EffectiveModernCpp.pdf),仅供翻译参考
> ! [PDF格式英文版下载](0.Public/EffectiveModernCpp.pdf),仅供翻译参考
# 目录
1. 类型推导
@ -19,8 +19,8 @@
3. [Item 3:理解decltype](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item3.md)
3. [Item 4:学会查看类型推导结果](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item4.md)
2. auto
1. [Item 5:优先考虑auto而非显式类型声明](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/2.auto/item5.md)
2. [Item 6:auto推导若非己愿使用显式类型初始化惯用法](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/2.auto/item6.md)
1. [Item 5:优先考虑auto而非显式类型声明](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/2.Auto/item5.md)
2. [Item 6:auto推导若非己愿使用显式类型初始化惯用法](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/2.Auto/item6.md)
3. 移步现代C++
1. [Item 7:区别使用()和{}创建对象](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item7.md)
2. [Item 8:优先考虑nullptr而非0和NULL](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item8.md)
@ -40,39 +40,39 @@
4. [Item 21:优先考虑使用std::make_unique和std::make_shared而非new](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item21.md) __由 @pusidun贡献__
5. [Item 22:当使用Pimpl惯用法请在实现文件中定义特殊成员函数](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item22.md) __由 @BlurryLight贡献__
5. 右值引用,移动语意,完美转发
1. [Item 23:理解std::move和std::forward](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item23.md) __由 @BlurryLight贡献__
2. [Item 24:区别通用引用和右值引用](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item24.md) __由 @BlurryLight贡献__
3. [Item 25:对于右值引用使用std::move对于通用引用使用std::forward](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item25.md)__由 @wendajiang贡献__
4. [Item 26:避免重载通用引用](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item26.md)__由 @wendajiang贡献__
5. [Item 27:熟悉重载通用引用的替代品](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item27.md)__由 @wendajiang贡献__
6. [Item 28:理解引用折叠](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item28.md)__由 @wendajiang贡献__
7. [Item 29:认识移动操作的缺点](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item29.md) __由 @wendajiang贡献__
8. [Item 30:熟悉完美转发失败的情况](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RvalueReferences_MovingSemantics_And_PerfectForwarding/item30.md)__由 @wendajiang贡献__
1. [Item 23:理解std::move和std::forward](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item23.md) __由 @BlurryLight贡献__
2. [Item 24:区别通用引用和右值引用](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item24.md) __由 @BlurryLight贡献__
3. [Item 25:对于右值引用使用std::move对于通用引用使用std::forward](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item25.md)__由 @wendajiang贡献__
4. [Item 26:避免重载通用引用](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item26.md)__由 @wendajiang贡献__
5. [Item 27:熟悉重载通用引用的替代品](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item27.md)__由 @wendajiang贡献__
6. [Item 28:理解引用折叠](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item28.md)__由 @wendajiang贡献__
7. [Item 29:认识移动操作的缺点](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item29.md) __由 @wendajiang贡献__
8. [Item 30:熟悉完美转发失败的情况](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/5.RRefMovSemPerfForw/item30.md)__由 @wendajiang贡献__
6. Lambda表达式
1. [Item 31:避免使用默认捕获模式](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.Lambda%20Expressions/item31.md) __由 @LucienXian贡献__
2. [Item 32:使用初始化捕获来移动对象到闭包中](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.Lambda%20Expressions/item32.md) __由 @LucienXian贡献__
3. [Item 33:对于std::forward的auto&&形参使用decltype](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.Lambda%20Expressions/item33.md) __由 @LucienXian贡献__
4. [Item 34:优先考虑lambda表达式而非std::bind](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.Lambda%20Expressions/item34.md) __由 @LucienXian贡献__
1. [Item 31:避免使用默认捕获模式](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.LambdaExpressions/item31.md) __由 @LucienXian贡献__
2. [Item 32:使用初始化捕获来移动对象到闭包中](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.LambdaExpressions/item32.md) __由 @LucienXian贡献__
3. [Item 33:对于std::forward的auto&&形参使用decltype](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.LambdaExpressions/item33.md) __由 @LucienXian贡献__
4. [Item 34:优先考虑lambda表达式而非std::bind](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/6.LambdaExpressions/item34.md) __由 @LucienXian贡献__
7. 并发API
1. [Item 35:优先考虑基于任务的编程而非基于线程的编程](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/Item35.md) __由 @wendajiang贡献__
2. [Item 36:如果有异步的必要请指定std::launch::threads](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/item36.md) __由 @wendajiang贡献__
3. [Item 37:从各个方面使得std::threads unjoinable](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/item37.md) __由 @wendajiang贡献__
4. [Item 38:关注不同线程句柄析构行为](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/item38.md) __由 @wendajiang贡献__
5. [Item 39:考虑对于单次事件通信使用void](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/item39.md) __由 @wendajiang贡献__
6. [Item 40:对于并发使用std::atomicvolatile用于特殊内存区](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.The%20Concurrency%20API/item40.md) __由 @wendajiang贡献__
1. [Item 35:优先考虑基于任务的编程而非基于线程的编程](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/Item35.md) __由 @wendajiang贡献__
2. [Item 36:如果有异步的必要请指定std::launch::threads](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/item36.md) __由 @wendajiang贡献__
3. [Item 37:从各个方面使得std::threads unjoinable](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/item37.md) __由 @wendajiang贡献__
4. [Item 38:关注不同线程句柄析构行为](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/item38.md) __由 @wendajiang贡献__
5. [Item 39:考虑对于单次事件通信使用void](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/item39.md) __由 @wendajiang贡献__
6. [Item 40:对于并发使用std::atomicvolatile用于特殊内存区](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.5.TheConcurrencyAPI/item40.md) __由 @wendajiang贡献__
8. 微调
1. [Item 41:对于那些可移动总是被拷贝的形参使用传值方式](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/8.Tweaks/item41.md) __由 @wendajiang贡献__
2. [Item 42:考虑就地创建而非插入](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/8.Tweaks/item42.md) __由 @wendajiang贡献__
**[PDF格式中文版下载](./translate.public/translate-zh-combine.pdf)**
# 其他资源
+ 本书的**[PDF格式中文版](./0.Public/translated/translate-zh-combine.pdf)**该版本通常同步或者滞后于当前Markdown文档
+ [Effective C++ Xmind Doc](./0.Public/EffectModernC++.xmind)
## 贡献者
感谢所有参与翻译/勘误/建议的贡献者们~
<a href="https://github.com/kelthuzadx/EffectiveModernCppChinese/graphs/contributors"><img src="https://opencollective.com/EffectiveModernCppChinese/contributors.svg?width=890&button=false" /></a>
## 赞助翻译
🙏 [[Become a backer](https://opencollective.com/EffectiveModernCppChinese#backer)]