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
Effective C++, Third Edition
“Every C++ professional needs a copy of Effective C++. It is an absolute must-read for anyone …
video
Effective Modern C++ live!
What's the best way for one thread to notify another that an event has taken place? …
book
C++ Software Design
Good software design is essential for the success of your project, but designing software is hard …
book
The C++ Programming Language, 4th Edition
The new C++11 standard allows programmers to express ideas more clearly, simply, and directly, and to …