Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14 (Paperback)

Scott Meyers

買這商品的人也買了...

商品描述

Coming to grips with C++11 and C++14 is more than a matter of familiarizing yourself with the features they introduce (e.g., auto type declarations, move semantics, lambda expressions, and concurrency support). The challenge is learning to use those features effectively—so that your software is correct, efficient, maintainable, and portable. That’s where this practical book comes in. It describes how to write truly great software using C++11 and C++14—i.e. using modern C++.

Topics include:

  • The pros and cons of braced initialization, noexcept specifications, perfect forwarding, and smart pointer make functions
  • The relationships among std::move, std::forward, rvalue references, and universal references
  • Techniques for writing clear, correct, effective lambda expressions
  • How std::atomic differs from volatile, how each should be used, and how they relate to C++'s concurrency API
  • How best practices in "old" C++ programming (i.e., C++98) require revision for software development in modern C++

Effective Modern C++ follows the proven guideline-based, example-driven format of Scott Meyers' earlier books, but covers entirely new material.

商品描述(中文翻譯)

掌握C++11和C++14不僅僅是熟悉它們引入的功能(例如,auto類型聲明、移動語義、lambda表達式和並發支持)。挑戰在於學習如何有效地使用這些功能,以確保您的軟件正確、高效、易於維護和可移植。這就是這本實用書的用途。它描述了如何使用C++11和C++14編寫真正優秀的軟件,即使用現代C++。

主題包括:
- 大括號初始化、noexcept規範、完美轉發和智能指針make函數的優缺點
- std::move、std::forward、右值引用和通用引用之間的關係
- 編寫清晰、正確、有效的lambda表達式的技巧
- std::atomic與volatile的區別,它們應該如何使用,以及它們與C++的並發API的關係
- 在現代C++中,為了軟件開發,需要修訂“舊”C++編程的最佳實踐(即C++98)

《Effective Modern C++》遵循Scott Meyers早期書籍的基於指南和以示例驅動的格式,但涵蓋全新的內容。