Book description
NoneTable of contents
- Copyright/Revision History
- From the Publisher
- Acknowledgments
- Introduction
- 1. Deducing Types
- 2. auto
-
3. Moving to Modern C++
- Item 7:âDistinguish between () and {} when creating objects.
- Item 8:âPrefer nullptr to 0 and NULL.
- Item 9:âPrefer alias declarations to typedefs.
- Item 10:âPrefer scoped enums to unscoped enums.
- Item 11:âPrefer deleted functions to private undefined ones.
- Item 12:âDeclare overriding functions override.
- Item 13:âPrefer const_iterators to iterators.
- Item 14:âDeclare functions noexcept if they wonât emit exceptions.
- Item 15:âUse constexpr whenever possible.
- Item 16:âMake const member functions thread safe.
- Item 17:âUnderstand special member function generation.
-
4. Smart Pointers
- Item 18:âUse std::unique_ptr for exclusive-ownership resource management.
- Item 19:âUse std::shared_ptr for shared-ownership resource management.
- Item 20:âUse std::weak_ptr for std::shared_ptr-like pointers that can dangle.
- Item 21:âPrefer std::make_unique and std::make_shared to direct use of new.
- Item 22:âWhen using the Pimpl Idiom, define special member functions in the implementation file.
-
5. Rvalue References, Move Semantics, and Perfect Forwarding
- Item 23:âUnderstand std::move and std::forward.
- Item 24:âDistinguish universal references from rvalue references.
- Item 25:âUse std::move on rvalue references, std::forward on universal references.
- Item 26:âAvoid overloading on universal references.
- Item 27:âFamiliarize yourself with alternatives to overloading on universal references.
- Item 28:âUnderstand reference collapsing.
- Item 29:âAssume that move operations are not present, not cheap, and not used.
- Item 30:âFamiliarize yourself with perfect forwarding failure cases.
- 6. Lambda Expressions
-
7. The Concurrency API
- Item 35:âPrefer task-based programming to thread-based.
- Item 36:âSpecify std::launch::async if asynchronicity is essential.
- Item 37:âMake std::threads unjoinable on all paths.
- Item 38:âBe aware of varying thread handle destructor behavior.
- Item 39:âConsider void futures for one-shot event communication.
- Item 40:âUse std::atomic for concurrency, volatile for special memory.
- 8. Tweaks
- Index
Product information
- Title: Effective Modern C++
- Author(s):
- Release date:
- Publisher(s): O'Reilly Media, Inc.
- ISBN: None
You might also like
book
Mythical Man-Month, The: Essays on Software Engineering, Anniversary Edition, 2nd Edition
Few books on software project management have been as influential and timeless as The Mythical Man-Month. …
book
Designing Data-Intensive Applications
Data is at the center of many challenges in system design today. Difficult issues need to …
book
Tidy First?
Messy code is a nuisance. "Tidying" code, to make it more readable, requires breaking it up …
book
Refactoring: Improving the Design of Existing Code
Fully Revised and Updated–Includes New Refactorings and Code Examples “Any fool can write code that a …