Scott Meyers is one of the world's foremost experts on C++. He's best known for his chart-topping Effective C++ books—Effective Modern C++ (new!
Meer over Scott MeyersEffective Modern C++
42 Specific Ways to Improve Your Use of C++11 and C++14
Paperback Engels 2015 1e druk 9781491903995Samenvatting
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.
"After I learned the C++ basics, I then learned how to use C++ in production code from Meyer's series of Effective C++ books. Effective Modern C++ is the most important how-to book for advice on key guidelines, styles, and idioms to use modern C++ effectively and well. Don't own it yet? Buy this one. Now". - Herb Sutter, Chair of ISO C++ Standards Committee and C++ Software Architect at Microsoft.
Specificaties
Lezersrecensies
Inhoudsopgave
Acknowledgments
Introduction
1. Deducing Types
-Understand template type deduction
-Understand auto type deduction
-Understand decltype
-Know how to view deduced types
2auto
-Prefer auto to explicit type declarations
-Use the explicitly typed initializer idiom when auto deduces undesired types
3. Moving to Modern C++
-Distinguish between () and {} when creating objects
-Prefer nullptr to 0 and NULL
-Prefer alias declarations to typedefs
-Prefer scoped enums to unscoped enums
-Prefer deleted functions to private undefined ones
-Declare overriding functions override
-Prefer const_iterators to iterators
-Declare functions noexcept if they won’t emit exceptions
-Use constexpr whenever possible
-Make const member functions thread safe
-Understand special member function generation
4. Smart Pointers
-Use std::unique_ptr for exclusive-ownership resource management
-Use std::shared_ptr for shared-ownership resource management
-Use std::weak_ptr for std::shared_ptr-like pointers that can dangle
-Prefer std::make_unique and std::make_shared to direct use of new
-When using the Pimpl Idiom, define special member functions in the implementation file
5. Rvalue References, Move Semantics, and Perfect Forwarding
-Understand std::move and std::forward
-Distinguish universal references from rvalue references
-Use std::move on rvalue references, std::forward on universal references
-Avoid overloading on universal references
-Familiarize yourself with alternatives to overloading on universal reference
-Understand reference collapsing
-Assume that move operations are not present, not cheap, and not used
-Familiarize yourself with perfect forwarding failure cases
6. Lambda Expressions
-Avoid default capture modes
-Use init capture to move objects into closures
-Use decltype on auto Item 33:&& parameters to std::forward them
-Prefer lambdas to std::bind
7. The Concurrency API
-Prefer task-based programming to thread-based
-Specify std::launch::async if asynchronicity is essential
-Make std::threads unjoinable on all paths
-Be aware of varying thread handle destructor behavior
-Consider void futures for one-shot event communication
-Use std::atomic for concurrency, volatile for special memory
8. Tweaks
-Consider pass by value for copyable parameters that are cheap to move and always copied
-Consider emplacement instead of insertion
Index
Rubrieken
- advisering
- algemeen management
- coaching en trainen
- communicatie en media
- economie
- financieel management
- inkoop en logistiek
- internet en social media
- it-management / ict
- juridisch
- leiderschap
- marketing
- mens en maatschappij
- non-profit
- ondernemen
- organisatiekunde
- personal finance
- personeelsmanagement
- persoonlijke effectiviteit
- projectmanagement
- psychologie
- reclame en verkoop
- strategisch management
- verandermanagement
- werk en loopbaan