Effective Modern C++

  1. Chapter 1 Deducing Types
    1. Item 1: Understand template type deduction.
    2. Item 2: Understand auto type deduction.
    3. Item 3: Understand decltype.
    4. Item 4: Know how to view deduced types.
  2. Chapter 2 auto
    1. Item 5: Prefer auto to explicit type declarations.
    2. Item 6: Use the explicitly typed initializer idiom when auto deduces undesired types.
  3. Chapter 3 Moving to Modern C++
    1. Item 7: Distinguish between () and {} when creating objects.
    2. Item 8: Prefer nullptr to 0 and NULL.
    3. Item 9: Prefer alias declarations to typedefs.
    4. Item 10: Prefer scoped enums to unscoped enums.
    5. Item 11: Prefer deleted functions to private undefined ones.
    6. Item 12: Declare overriding functions override.
    7. Item 13: Prefer const_iterators to iterators.
    8. Item 14: Declare functions noexcept if they won’t emit exceptions.
    9. Item 15: Use constexpr whenever possible.
    10. Item 16: Make const member functions thread safe.
    11. Item 17: Understand special member function generation.
  4. Chapter 4 Smart Pointers
    1. Item 18: Use std::unique_ptr for exclusive-ownership resource management.
    2. Item 19: Use std::shared_ptr for shared-ownership resource management.
    3. Item 20: Use std::weak_ptr for std::shared_ptr-like pointers that can dangle.
    4. Item 21: Prefer std::make_unique and std::make_shared to direct use of new.
    5. Item 22: When using the Pimpl Idiom, define special member functions in the implementation file.
  5. Chapter 5 Rvalue References, Move Semantics, and Perfect Forwarding
    1. Item 23: Understand std::move and std::forward.
    2. Item 24: Distinguish universal references from rvalue references.
    3. Item 25: Use std::move on rvalue references, std::forward on universal references.
    4. Item 26: Avoid overloading on universal references.
    5. Item 27: Familiarize yourself with alternatives to overloading on universal references.
    6. Item 28: Understand reference collapsing.
    7. Item 29: Assume that move operations are not present, not cheap, and not used.
    8. Item 30: Familiarize yourself with perfect forwarding failure cases.
  6. Chapter 7 Lambda Expressions
    1. Item 31: Avoid default capture modes.
    2. Item 32: Use init capture to move objects into closures.
    3. Item 33: Use decltype on auto&& parameters to std::forward them.
    4. Item 34: Prefer lambdas to std::bind.
  7. Chapter 8 The Concurrency API
    1. Item 35: Prefer task-based programming to thread-based.
    2. Item 36: Specify std::launch::async if asynchronicity is essential.
    3. Item 37: Make std::threads unjoinable on all paths.
    4. Item 38: Be aware of varying thread handle destructor behavior.
    5. Item 39: Consider void futures for one-shot event communication.
    6. Item 40: Use std::atomic for concurrency, volatile for special memory.
  8. Chapter 9 Tweaks
    1. Item 41: Consider pass by value for copyable parameters that are cheap to move and always copied.
    2. Item 42: Consider emplacement instead of insertion.
//z 2014-12-10 16:50:12 L.21 '25788 BG57IV3@XCL T3293518056.K.F4064690091[T55,L3154,R102,V2526]

Effective Modern C++

42 Specific Ways to Improve Your Use of C++11 and C++14

By Scott Meyers

Publisher: O'Reilly Media

Final Release Date: November 2014

Pages: 336

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 featureseffectively—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.
//z 2014-12-10 16:50:12 L.21 '25788 BG57IV3@XCL T3293518056.K.F4064690091[T55,L3154,R102,V2526]

Title:
Effective Modern C++
By:
Scott Meyers
Publisher:
O'Reilly Media
Formats:
  • Print
  • Ebook
  • Safari Books Online
Print:
November 2014
Ebook:
November 2014
Pages:
336
Print ISBN:
978-1-4919-0399-5
| ISBN 10:
1-4919-0399-6
Ebook ISBN:
978-1-4919-0398-8
| ISBN 10:
1-4919-0398-8
posted @ 2014-12-10 16:53  BiG5  阅读(260)  评论(0编辑  收藏  举报