From a6b1a03b020a2c6c8d96bab3abd9642ff4bd2f1f Mon Sep 17 00:00:00 2001 From: David Date: Thu, 30 Jun 2022 00:11:34 +0800 Subject: [PATCH] use mdbook to deploy gh-pages for online watch --- .github/workflows/deploy.yml | 33 +++++++ .gitignore | 56 ++++++++++++ README.md | 86 +++++++++--------- book.toml | 10 ++ .../1.DeducingTypes}/item1.md | 0 .../1.DeducingTypes}/item2.md | 0 .../1.DeducingTypes}/item3.md | 0 .../1.DeducingTypes}/item4.md | 0 {2.Auto => src/2.Auto}/item5.md | 0 {2.Auto => src/2.Auto}/item6.md | 0 .../3.MovingToModernCpp}/item10.md | 0 .../3.MovingToModernCpp}/item11.md | 0 .../3.MovingToModernCpp}/item12.md | 0 .../3.MovingToModernCpp}/item13.md | 0 .../3.MovingToModernCpp}/item14.md | 0 .../3.MovingToModernCpp}/item15.md | 0 .../3.MovingToModernCpp}/item16.md | 0 .../3.MovingToModernCpp}/item17.md | 0 .../3.MovingToModernCpp}/item7.md | 0 .../3.MovingToModernCpp}/item8.md | 0 .../3.MovingToModernCpp}/item9.md | 0 .../4.SmartPointers}/item18.md | 0 .../4.SmartPointers}/item19.md | 0 .../4.SmartPointers}/item20.md | 0 .../4.SmartPointers}/item21.md | 0 .../4.SmartPointers}/item22.md | 0 .../4.SmartPointers}/media/item18_fig1.png | Bin .../4.SmartPointers}/media/item19_fig1.png | Bin .../4.SmartPointers}/media/item20_fig1.png | Bin .../4.SmartPointers}/media/item20_fig2.png | Bin .../5.RRefMovSemPerfForw}/item23.md | 0 .../5.RRefMovSemPerfForw}/item24.md | 0 .../5.RRefMovSemPerfForw}/item25.md | 0 .../5.RRefMovSemPerfForw}/item26.md | 0 .../5.RRefMovSemPerfForw}/item27.md | 0 .../5.RRefMovSemPerfForw}/item28.md | 0 .../5.RRefMovSemPerfForw}/item29.md | 0 .../5.RRefMovSemPerfForw}/item30.md | 0 .../media/item29_fig1.png | Bin .../media/item29_fig2.png | Bin .../6.LambdaExpressions}/item31.md | 0 .../6.LambdaExpressions}/item32.md | 0 .../6.LambdaExpressions}/item33.md | 0 .../6.LambdaExpressions}/item34.md | 0 .../7.TheConcurrencyAPI}/Item35.md | 0 .../7.TheConcurrencyAPI}/item36.md | 0 .../7.TheConcurrencyAPI}/item37.md | 0 .../7.TheConcurrencyAPI}/item38.md | 0 .../7.TheConcurrencyAPI}/item39.md | 0 .../7.TheConcurrencyAPI}/item40.md | 0 .../media/item38_fig1.png | Bin .../media/item38_fig2.png | Bin {8.Tweaks => src/8.Tweaks}/item41.md | 0 {8.Tweaks => src/8.Tweaks}/item42.md | 0 Introduction.md => src/Introduction.md | 0 src/SUMMARY.md | 11 +++ 56 files changed, 153 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 book.toml rename {1.DeducingTypes => src/1.DeducingTypes}/item1.md (100%) rename {1.DeducingTypes => src/1.DeducingTypes}/item2.md (100%) rename {1.DeducingTypes => src/1.DeducingTypes}/item3.md (100%) rename {1.DeducingTypes => src/1.DeducingTypes}/item4.md (100%) rename {2.Auto => src/2.Auto}/item5.md (100%) rename {2.Auto => src/2.Auto}/item6.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item10.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item11.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item12.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item13.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item14.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item15.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item16.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item17.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item7.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item8.md (100%) rename {3.MovingToModernCpp => src/3.MovingToModernCpp}/item9.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/item18.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/item19.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/item20.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/item21.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/item22.md (100%) rename {4.SmartPointers => src/4.SmartPointers}/media/item18_fig1.png (100%) rename {4.SmartPointers => src/4.SmartPointers}/media/item19_fig1.png (100%) rename {4.SmartPointers => src/4.SmartPointers}/media/item20_fig1.png (100%) rename {4.SmartPointers => src/4.SmartPointers}/media/item20_fig2.png (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item23.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item24.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item25.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item26.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item27.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item28.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item29.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/item30.md (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/media/item29_fig1.png (100%) rename {5.RRefMovSemPerfForw => src/5.RRefMovSemPerfForw}/media/item29_fig2.png (100%) rename {6.LambdaExpressions => src/6.LambdaExpressions}/item31.md (100%) rename {6.LambdaExpressions => src/6.LambdaExpressions}/item32.md (100%) rename {6.LambdaExpressions => src/6.LambdaExpressions}/item33.md (100%) rename {6.LambdaExpressions => src/6.LambdaExpressions}/item34.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/Item35.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/item36.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/item37.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/item38.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/item39.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/item40.md (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/media/item38_fig1.png (100%) rename {7.TheConcurrencyAPI => src/7.TheConcurrencyAPI}/media/item38_fig2.png (100%) rename {8.Tweaks => src/8.Tweaks}/item41.md (100%) rename {8.Tweaks => src/8.Tweaks}/item42.md (100%) rename Introduction.md => src/Introduction.md (100%) create mode 100644 src/SUMMARY.md diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..918850a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: github pages + +on: + push: + branches: + - master + paths: + - src/** + - book.toml + pull_request: + +jobs: + deploy: + runs-on: ubuntu-20.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v2 + + - name: Setup mdBook + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: '0.4.18' + # mdbook-version: 'latest' + + - run: mdbook build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/master' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./book diff --git a/.gitignore b/.gitignore index e43b0f9..e684273 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,57 @@ +# .gitignore_global +#################################### +######## OS generated files ######## +#################################### .DS_Store +.DS_Store? +*.swp +._* +.Spotlight-V100 +.Trashes +Icon? +ehthumbs.db +Thumbs.db +#################################### +############# Packages ############# +#################################### +*.7z +*.dmg +*.gz +*.iso +*.jar +*.rar +*.tar +*.zip +# Prerequisites +*.d +# Compiled Object files +*.slo +*.lo +*.o +*.obj +# Precompiled Headers +*.gch +*.pch +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +# Fortran module files +*.mod +*.smod +# Compiled Static libraries +*.lai +*.la +*.a +*.lib +# Executables +*.exe +*.out +*.app + +.vscode +.netrwhist + +.idea +target +book diff --git a/README.md b/README.md index d52b411..29f9fec 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 《Effective Modern C++ 》翻译 - + [![Backers on Open Collective](https://opencollective.com/EffectiveModernCppChinese/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/EffectiveModernCppChinese/sponsors/badge.svg)](#sponsors) @@ -15,55 +15,55 @@ ## 目录 0. [__简介__](Introduction.md) 1. __类型推导__ - 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) - 3. [Item 3:理解decltype](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item3.md) - 4. [Item 4:学会查看类型推导结果](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/1.DeducingTypes/item4.md) + 1. [Item 1:理解模板类型推导](src/1.DeducingTypes/item1.md) 已修订 + 2. [Item 2:理解auto类型推导](src/1.DeducingTypes/item2.md) + 3. [Item 3:理解decltype](src/1.DeducingTypes/item3.md) + 4. [Item 4:学会查看类型推导结果](src/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而非显式类型声明](src/2.Auto/item5.md) + 2. [Item 6:auto推导若非己愿,使用显式类型初始化惯用法](src/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) - 3. [Item 9:优先考虑别名声明而非typedefs](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item9.md) - 4. [Item 10:优先考虑限域枚举而非未限域枚举](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item10.md) 已修订 - 5. [Item 11:优先考虑使用deleted函数而非使用未定义的私有声明](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item11.md) - 6. [Item 12:使用override声明重载函数](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item12.md) - 7. [Item 13:优先考虑const_iterator而非iterator](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item13.md) - 8. [Item 14:如果函数不抛出异常请使用noexcept](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item14.md) - 9. [Item 15:尽可能的使用constexpr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item15.md) - 10. [Item 16:让const成员函数线程安全](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item16.md) 由 @windski贡献 - 11. [Item 17:理解特殊成员函数函数的生成](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/3.MovingToModernCpp/item17.md) + 1. [Item 7:区别使用()和{}创建对象](src/3.MovingToModernCpp/item7.md) + 2. [Item 8:优先考虑nullptr而非0和NULL](src/3.MovingToModernCpp/item8.md) + 3. [Item 9:优先考虑别名声明而非typedefs](src/3.MovingToModernCpp/item9.md) + 4. [Item 10:优先考虑限域枚举而非未限域枚举](src/3.MovingToModernCpp/item10.md) 已修订 + 5. [Item 11:优先考虑使用deleted函数而非使用未定义的私有声明](src/3.MovingToModernCpp/item11.md) + 6. [Item 12:使用override声明重载函数](src/3.MovingToModernCpp/item12.md) + 7. [Item 13:优先考虑const_iterator而非iterator](src/3.MovingToModernCpp/item13.md) + 8. [Item 14:如果函数不抛出异常请使用noexcept](src/3.MovingToModernCpp/item14.md) + 9. [Item 15:尽可能的使用constexpr](src/3.MovingToModernCpp/item15.md) + 10. [Item 16:让const成员函数线程安全](src/3.MovingToModernCpp/item16.md) 由 @windski贡献 + 11. [Item 17:理解特殊成员函数函数的生成](src/3.MovingToModernCpp/item17.md) 4. __智能指针__ - 1. [Item 18:对于独占资源使用std::unique_ptr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item18.md) 由 @wendajiang贡献 - 2. [Item 19:对于共享资源使用std::shared_ptr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item19.md) 已修订 - 3. [Item 20:当std::shard_ptr可能悬空时使用std::weak_ptr](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/4.SmartPointers/item20.md) 更新完成 - 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贡献 + 1. [Item 18:对于独占资源使用std::unique_ptr](src/4.SmartPointers/item18.md) 由 @wendajiang贡献 + 2. [Item 19:对于共享资源使用std::shared_ptr](src/4.SmartPointers/item19.md) 已修订 + 3. [Item 20:当std::shard_ptr可能悬空时使用std::weak_ptr](src/4.SmartPointers/item20.md) 更新完成 + 4. [Item 21:优先考虑使用std::make_unique和std::make_shared而非new](src/4.SmartPointers/item21.md) 由 @pusidun贡献 + 5. [Item 22:当使用Pimpl惯用法,请在实现文件中定义特殊成员函数](src/4.SmartPointers/item22.md) 由 @BlurryLight贡献 5. __右值引用,移动语义,完美转发__ - 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贡献 + 1. [Item 23:理解std::move和std::forward](src/5.RRefMovSemPerfForw/item23.md) 由 @BlurryLight贡献 + 2. [Item 24:区别通用引用和右值引用](src/5.RRefMovSemPerfForw/item24.md) 由 @BlurryLight贡献 + 3. [Item 25:对于右值引用使用std::move,对于通用引用使用std::forward](src/5.RRefMovSemPerfForw/item25.md)由 @wendajiang贡献 + 4. [Item 26:避免重载通用引用](src/5.RRefMovSemPerfForw/item26.md) 由 @wendajiang贡献 + 5. [Item 27:熟悉重载通用引用的替代品](src/5.RRefMovSemPerfForw/item27.md) 由 @wendajiang贡献 + 6. [Item 28:理解引用折叠](src/5.RRefMovSemPerfForw/item28.md) 由 @wendajiang贡献 + 7. [Item 29:认识移动操作的缺点](src/5.RRefMovSemPerfForw/item29.md) 由 @wendajiang贡献 + 8. [Item 30:熟悉完美转发失败的情况](src/5.RRefMovSemPerfForw/item30.md) 由 @wendajiang贡献 6. __Lambda表达式__ - 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贡献 + 1. [Item 31:避免使用默认捕获模式](src/6.LambdaExpressions/item31.md) 由 @LucienXian贡献 + 2. [Item 32:使用初始化捕获来移动对象到闭包中](src/6.LambdaExpressions/item32.md) 由 @LucienXian贡献 + 3. [Item 33:对于std::forward的auto&&形参使用decltype](src/6.LambdaExpressions/item33.md) 由 @LucienXian贡献 + 4. [Item 34:优先考虑lambda表达式而非std::bind](src/6.LambdaExpressions/item34.md) 由 @LucienXian贡献 7. __并发API__ - 1. [Item 35:优先考虑基于任务的编程而非基于线程的编程](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/Item35.md) 由 @wendajiang贡献 - 2. [Item 36:如果有异步的必要请指定std::launch::threads](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/item36.md) 由 @wendajiang贡献 - 3. [Item 37:从各个方面使得std::threads unjoinable](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/item37.md) 由 @wendajiang贡献 - 4. [Item 38:关注不同线程句柄析构行为](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/item38.md) 由 @wendajiang贡献 - 5. [Item 39:考虑对于单次事件通信使用void](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/item39.md) 由 @wendajiang贡献 - 6. [Item 40:对于并发使用std::atomic,volatile用于特殊内存区](https://github.com/kelthuzadx/EffectiveModernCppChinese/blob/master/7.TheConcurrencyAPI/item40.md) 由 @wendajiang贡献 + 1. [Item 35:优先考虑基于任务的编程而非基于线程的编程](src/7.TheConcurrencyAPI/Item35.md) 由 @wendajiang贡献 + 2. [Item 36:如果有异步的必要请指定std::launch::threads](src/7.TheConcurrencyAPI/item36.md) 由 @wendajiang贡献 + 3. [Item 37:从各个方面使得std::threads unjoinable](src/7.TheConcurrencyAPI/item37.md) 由 @wendajiang贡献 + 4. [Item 38:关注不同线程句柄析构行为](src/7.TheConcurrencyAPI/item38.md) 由 @wendajiang贡献 + 5. [Item 39:考虑对于单次事件通信使用void](src/7.TheConcurrencyAPI/item39.md) 由 @wendajiang贡献 + 6. [Item 40:对于并发使用std::atomic,volatile用于特殊内存区](src/7.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贡献 + 1. [Item 41:对于那些可移动总是被拷贝的形参使用传值方式](src/8.Tweaks/item41.md) 由 @wendajiang贡献 + 2. [Item 42:考虑就地创建而非插入](src/8.Tweaks/item42.md) 由 @wendajiang贡献 ## 其他资源 + 本书[PDF格式的中文版](./0.Public/translated/translate-zh-combine.pdf)见于此,该版本通常同步或者滞后于当前Markdown文档 diff --git a/book.toml b/book.toml new file mode 100644 index 0000000..be90b7f --- /dev/null +++ b/book.toml @@ -0,0 +1,10 @@ +[book] +authors = ["wendajiang"] +language = "zh" +multilingual = false +src = "src" +title = "Effective Modern C++" + +[output.html] +mathjax-support = true +no-section-label = true diff --git a/1.DeducingTypes/item1.md b/src/1.DeducingTypes/item1.md similarity index 100% rename from 1.DeducingTypes/item1.md rename to src/1.DeducingTypes/item1.md diff --git a/1.DeducingTypes/item2.md b/src/1.DeducingTypes/item2.md similarity index 100% rename from 1.DeducingTypes/item2.md rename to src/1.DeducingTypes/item2.md diff --git a/1.DeducingTypes/item3.md b/src/1.DeducingTypes/item3.md similarity index 100% rename from 1.DeducingTypes/item3.md rename to src/1.DeducingTypes/item3.md diff --git a/1.DeducingTypes/item4.md b/src/1.DeducingTypes/item4.md similarity index 100% rename from 1.DeducingTypes/item4.md rename to src/1.DeducingTypes/item4.md diff --git a/2.Auto/item5.md b/src/2.Auto/item5.md similarity index 100% rename from 2.Auto/item5.md rename to src/2.Auto/item5.md diff --git a/2.Auto/item6.md b/src/2.Auto/item6.md similarity index 100% rename from 2.Auto/item6.md rename to src/2.Auto/item6.md diff --git a/3.MovingToModernCpp/item10.md b/src/3.MovingToModernCpp/item10.md similarity index 100% rename from 3.MovingToModernCpp/item10.md rename to src/3.MovingToModernCpp/item10.md diff --git a/3.MovingToModernCpp/item11.md b/src/3.MovingToModernCpp/item11.md similarity index 100% rename from 3.MovingToModernCpp/item11.md rename to src/3.MovingToModernCpp/item11.md diff --git a/3.MovingToModernCpp/item12.md b/src/3.MovingToModernCpp/item12.md similarity index 100% rename from 3.MovingToModernCpp/item12.md rename to src/3.MovingToModernCpp/item12.md diff --git a/3.MovingToModernCpp/item13.md b/src/3.MovingToModernCpp/item13.md similarity index 100% rename from 3.MovingToModernCpp/item13.md rename to src/3.MovingToModernCpp/item13.md diff --git a/3.MovingToModernCpp/item14.md b/src/3.MovingToModernCpp/item14.md similarity index 100% rename from 3.MovingToModernCpp/item14.md rename to src/3.MovingToModernCpp/item14.md diff --git a/3.MovingToModernCpp/item15.md b/src/3.MovingToModernCpp/item15.md similarity index 100% rename from 3.MovingToModernCpp/item15.md rename to src/3.MovingToModernCpp/item15.md diff --git a/3.MovingToModernCpp/item16.md b/src/3.MovingToModernCpp/item16.md similarity index 100% rename from 3.MovingToModernCpp/item16.md rename to src/3.MovingToModernCpp/item16.md diff --git a/3.MovingToModernCpp/item17.md b/src/3.MovingToModernCpp/item17.md similarity index 100% rename from 3.MovingToModernCpp/item17.md rename to src/3.MovingToModernCpp/item17.md diff --git a/3.MovingToModernCpp/item7.md b/src/3.MovingToModernCpp/item7.md similarity index 100% rename from 3.MovingToModernCpp/item7.md rename to src/3.MovingToModernCpp/item7.md diff --git a/3.MovingToModernCpp/item8.md b/src/3.MovingToModernCpp/item8.md similarity index 100% rename from 3.MovingToModernCpp/item8.md rename to src/3.MovingToModernCpp/item8.md diff --git a/3.MovingToModernCpp/item9.md b/src/3.MovingToModernCpp/item9.md similarity index 100% rename from 3.MovingToModernCpp/item9.md rename to src/3.MovingToModernCpp/item9.md diff --git a/4.SmartPointers/item18.md b/src/4.SmartPointers/item18.md similarity index 100% rename from 4.SmartPointers/item18.md rename to src/4.SmartPointers/item18.md diff --git a/4.SmartPointers/item19.md b/src/4.SmartPointers/item19.md similarity index 100% rename from 4.SmartPointers/item19.md rename to src/4.SmartPointers/item19.md diff --git a/4.SmartPointers/item20.md b/src/4.SmartPointers/item20.md similarity index 100% rename from 4.SmartPointers/item20.md rename to src/4.SmartPointers/item20.md diff --git a/4.SmartPointers/item21.md b/src/4.SmartPointers/item21.md similarity index 100% rename from 4.SmartPointers/item21.md rename to src/4.SmartPointers/item21.md diff --git a/4.SmartPointers/item22.md b/src/4.SmartPointers/item22.md similarity index 100% rename from 4.SmartPointers/item22.md rename to src/4.SmartPointers/item22.md diff --git a/4.SmartPointers/media/item18_fig1.png b/src/4.SmartPointers/media/item18_fig1.png similarity index 100% rename from 4.SmartPointers/media/item18_fig1.png rename to src/4.SmartPointers/media/item18_fig1.png diff --git a/4.SmartPointers/media/item19_fig1.png b/src/4.SmartPointers/media/item19_fig1.png similarity index 100% rename from 4.SmartPointers/media/item19_fig1.png rename to src/4.SmartPointers/media/item19_fig1.png diff --git a/4.SmartPointers/media/item20_fig1.png b/src/4.SmartPointers/media/item20_fig1.png similarity index 100% rename from 4.SmartPointers/media/item20_fig1.png rename to src/4.SmartPointers/media/item20_fig1.png diff --git a/4.SmartPointers/media/item20_fig2.png b/src/4.SmartPointers/media/item20_fig2.png similarity index 100% rename from 4.SmartPointers/media/item20_fig2.png rename to src/4.SmartPointers/media/item20_fig2.png diff --git a/5.RRefMovSemPerfForw/item23.md b/src/5.RRefMovSemPerfForw/item23.md similarity index 100% rename from 5.RRefMovSemPerfForw/item23.md rename to src/5.RRefMovSemPerfForw/item23.md diff --git a/5.RRefMovSemPerfForw/item24.md b/src/5.RRefMovSemPerfForw/item24.md similarity index 100% rename from 5.RRefMovSemPerfForw/item24.md rename to src/5.RRefMovSemPerfForw/item24.md diff --git a/5.RRefMovSemPerfForw/item25.md b/src/5.RRefMovSemPerfForw/item25.md similarity index 100% rename from 5.RRefMovSemPerfForw/item25.md rename to src/5.RRefMovSemPerfForw/item25.md diff --git a/5.RRefMovSemPerfForw/item26.md b/src/5.RRefMovSemPerfForw/item26.md similarity index 100% rename from 5.RRefMovSemPerfForw/item26.md rename to src/5.RRefMovSemPerfForw/item26.md diff --git a/5.RRefMovSemPerfForw/item27.md b/src/5.RRefMovSemPerfForw/item27.md similarity index 100% rename from 5.RRefMovSemPerfForw/item27.md rename to src/5.RRefMovSemPerfForw/item27.md diff --git a/5.RRefMovSemPerfForw/item28.md b/src/5.RRefMovSemPerfForw/item28.md similarity index 100% rename from 5.RRefMovSemPerfForw/item28.md rename to src/5.RRefMovSemPerfForw/item28.md diff --git a/5.RRefMovSemPerfForw/item29.md b/src/5.RRefMovSemPerfForw/item29.md similarity index 100% rename from 5.RRefMovSemPerfForw/item29.md rename to src/5.RRefMovSemPerfForw/item29.md diff --git a/5.RRefMovSemPerfForw/item30.md b/src/5.RRefMovSemPerfForw/item30.md similarity index 100% rename from 5.RRefMovSemPerfForw/item30.md rename to src/5.RRefMovSemPerfForw/item30.md diff --git a/5.RRefMovSemPerfForw/media/item29_fig1.png b/src/5.RRefMovSemPerfForw/media/item29_fig1.png similarity index 100% rename from 5.RRefMovSemPerfForw/media/item29_fig1.png rename to src/5.RRefMovSemPerfForw/media/item29_fig1.png diff --git a/5.RRefMovSemPerfForw/media/item29_fig2.png b/src/5.RRefMovSemPerfForw/media/item29_fig2.png similarity index 100% rename from 5.RRefMovSemPerfForw/media/item29_fig2.png rename to src/5.RRefMovSemPerfForw/media/item29_fig2.png diff --git a/6.LambdaExpressions/item31.md b/src/6.LambdaExpressions/item31.md similarity index 100% rename from 6.LambdaExpressions/item31.md rename to src/6.LambdaExpressions/item31.md diff --git a/6.LambdaExpressions/item32.md b/src/6.LambdaExpressions/item32.md similarity index 100% rename from 6.LambdaExpressions/item32.md rename to src/6.LambdaExpressions/item32.md diff --git a/6.LambdaExpressions/item33.md b/src/6.LambdaExpressions/item33.md similarity index 100% rename from 6.LambdaExpressions/item33.md rename to src/6.LambdaExpressions/item33.md diff --git a/6.LambdaExpressions/item34.md b/src/6.LambdaExpressions/item34.md similarity index 100% rename from 6.LambdaExpressions/item34.md rename to src/6.LambdaExpressions/item34.md diff --git a/7.TheConcurrencyAPI/Item35.md b/src/7.TheConcurrencyAPI/Item35.md similarity index 100% rename from 7.TheConcurrencyAPI/Item35.md rename to src/7.TheConcurrencyAPI/Item35.md diff --git a/7.TheConcurrencyAPI/item36.md b/src/7.TheConcurrencyAPI/item36.md similarity index 100% rename from 7.TheConcurrencyAPI/item36.md rename to src/7.TheConcurrencyAPI/item36.md diff --git a/7.TheConcurrencyAPI/item37.md b/src/7.TheConcurrencyAPI/item37.md similarity index 100% rename from 7.TheConcurrencyAPI/item37.md rename to src/7.TheConcurrencyAPI/item37.md diff --git a/7.TheConcurrencyAPI/item38.md b/src/7.TheConcurrencyAPI/item38.md similarity index 100% rename from 7.TheConcurrencyAPI/item38.md rename to src/7.TheConcurrencyAPI/item38.md diff --git a/7.TheConcurrencyAPI/item39.md b/src/7.TheConcurrencyAPI/item39.md similarity index 100% rename from 7.TheConcurrencyAPI/item39.md rename to src/7.TheConcurrencyAPI/item39.md diff --git a/7.TheConcurrencyAPI/item40.md b/src/7.TheConcurrencyAPI/item40.md similarity index 100% rename from 7.TheConcurrencyAPI/item40.md rename to src/7.TheConcurrencyAPI/item40.md diff --git a/7.TheConcurrencyAPI/media/item38_fig1.png b/src/7.TheConcurrencyAPI/media/item38_fig1.png similarity index 100% rename from 7.TheConcurrencyAPI/media/item38_fig1.png rename to src/7.TheConcurrencyAPI/media/item38_fig1.png diff --git a/7.TheConcurrencyAPI/media/item38_fig2.png b/src/7.TheConcurrencyAPI/media/item38_fig2.png similarity index 100% rename from 7.TheConcurrencyAPI/media/item38_fig2.png rename to src/7.TheConcurrencyAPI/media/item38_fig2.png diff --git a/8.Tweaks/item41.md b/src/8.Tweaks/item41.md similarity index 100% rename from 8.Tweaks/item41.md rename to src/8.Tweaks/item41.md diff --git a/8.Tweaks/item42.md b/src/8.Tweaks/item42.md similarity index 100% rename from 8.Tweaks/item42.md rename to src/8.Tweaks/item42.md diff --git a/Introduction.md b/src/Introduction.md similarity index 100% rename from Introduction.md rename to src/Introduction.md diff --git a/src/SUMMARY.md b/src/SUMMARY.md new file mode 100644 index 0000000..2534601 --- /dev/null +++ b/src/SUMMARY.md @@ -0,0 +1,11 @@ +# Summary + +- [Introduction](./Introduction.md) +- [Chapter 1. Deducing Types]() + - [Item 1: Understanding template type deduction](./1.DeducingTypes/item1.md) + - [Item 2: Understand auto type deduction](./1.DeducingTypes/item2.md) + - [Item 3: Understand decltype](./1.DeducingTypes/item3.md) + - [Item 4: Know how to view deduced types](./1.DeducingTypes/item4.md) +- [Chpater 2. auto]() + - [Item 5: Prefer auto to explicit type declarations](./2.Auto/item5.md) + - [Item 6: Use the explicitly typed initializer idiom when auto deduces undesired types](./2.Auto/item6.md)