Embracing Modern C++ Safely

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Maximize Reward and Minimize Risk with Modern C++

Embracing Modern C++ Safely shows students how to make effective use of the new and enhanced language features of modern C++ without falling victim to potential pitfalls.

Based on their years of experience with large, mission-critical projects, four leading C++ authorities divide C++11/14 language features into three categories: Safe, Conditionally Safe, and Unsafe. Safe features offer compelling value, are easy to use productively, and are relatively difficult to misuse. Conditionally Safe features offer significant value but come with risks that require significant expertise and familiarity before use. Unsafe features have an especially poor risk/reward ratio, are easy to misuse, and are beneficial in only the most specialized circumstances.

This book distills the C++ community's years of experience applying C++11 and C++14 features and will help students make effective and safe design decisions that reflect real-world, economic engineering tradeoffs in large-scale, diverse software development environments. The authors use examples derived from real code bases to illustrate every finding objectively and to illuminate key issues. Each feature identifies the sound use cases, hidden pitfalls, and shortcomings of that language feature. After reading this book, students will:

  • Understand what each C++11/14 feature does and where it works best
  • Recognize how to work around show-stopping pitfalls and annoying corner cases
  • Know which features demand additional training, experience, and peer review
  • Gain insights for preparing coding standards and style guides that suit the needs of organizations
  • Be equipped to introduce modern C++ incrementally and judiciously into established code bases

Seasoned C++ developers, team leads, and technical managers who want to improve productivity, code quality, and maintainability will find the insights in this modular, meticulously organized reference indispensable.

Register this book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Author(s): John Lakos, Vittorio Romeo, Rostislav Khlebnikov, Alisdair Meredith
Edition: 1
Publisher: Addison-Wesley Professional
Year: 2021

Language: English
Commentary: Publisher PDF | Published: by Addison-Wesley Professional (December 23, 2021)
Pages: 1376
City: Boston, MA
Tags: C++ Programming; C++ Programming Language; Software Engineering; Software Development; Software Development Guidelines; Software Development Best Practices; Core Guidelines; Best Practices; C++11; C++14

Cover
Half Title
Title Page
Copyright Page
Contents
Foreword
Foreword
Acknowledgments
About the Authors
Chapter 0 Introduction
What Makes This Book Different
Scope for the First Edition
The EMC++S Guiding Principles
What Do We Mean by Safely?
A Safe Feature
A Conditionally Safe Feature
An Unsafe Feature
Modern C++ Feature Catalog
How to Use This Book
Chapter 1 Safe Features
1.1 C++11
Attribute Syntax Generalized Attribute Support
Consecutive >s Consecutive Right-Angle Brackets
decltype Operator for Extracting Expression Types
Defaulted Functions Using = default for Special Member Functions
Delegating Ctors Constructors Calling Other Constructors
Deleted Functions Using = delete for Arbitrary Functions
explicit Operators Explicit Conversion Operators
Function static '11 Thread-Safe Function-Scope static Variables
Local Types '11 Local/Unnamed Types as Template Arguments
long long The long long (≥64 bits) Integral Type
noreturn The [[noreturn]] Attribute
nullptr The Null-Pointer-Literal Keyword
override The override Member-Function Specifier
Raw String Literals Syntax for Unprocessed String Contents
static_assert Compile-Time Assertions
Trailing Return Trailing Function Return Types
Unicode Literals Unicode String Literals
using Aliases Type/Template Aliases (Extended typedef)
1.2 C++14
Aggregate Init '14 Aggregates Having Default Member Initializers
Binary Literals Binary Literals: The 0b Prefix
deprecated The [[deprecated]] Attribute
Digit Separators The Digit Separator (')
Variable Templates Templated Variable Declarations/Definitions
Chapter 2 Conditionally Safe Features
2.1 C++11
alignas The alignas Specifier
alignof The alignof Operator
auto Variables Variables of Automatically Deduced Type
Braced Init Braced-Initialization Syntax: {}
constexpr Functions Compile-Time Invocable Functions
constexpr Variables Compile-Time Accessible Variables
Default Member Init Default class/union Member Initializers
enum class Strongly Typed, Scoped Enumerations
extern template Explicit-Instantiation Declarations
Forwarding References Forwarding References (T&&)
Generalized PODs '11 Trivial and Standard-Layout Types
Inheriting Constructors Inheriting Base-Class Constructors
initializer_list List Initialization: std::initializer_list
Lambdas Anonymous Function Objects (Closures
noexcept Operator Asking if an Expression Cannot throw
Opaque enums Opaque Enumeration Declarations
Range for Range-Based for Loops
Rvalue References Move Semantics and Rvalue References (&&)
Underlying Type '11 Explicit Enumeration Underlying Type
User-Defined Literals User-Defined Literal Operators
Variadic Templates Variable-Argument-Count Templates
2.2 C++14
constexpr Functions '14 Relaxed Restrictions on constexpr Functions
Generic Lambdas Lambdas Having a Templated Call Operator
Lambda Init-Captures Lambda-Capture Expressions
Chapter 3 Unsafe Features
3.1 C++11
carries_dependency The [[carries_dependency]] Attribute
final Prohibiting Overriding and Derivation
friend '11 Extended friend Declarations
inline namespace Transparently Nested Namespaces
noexcept Specifier The Nonthrowing-Function Specifier
Ref-Qualifiers Reference-Qualified Member Functions
union '11 Unions Having Non-Trivial Members
3.2 C++14
auto Return Function (auto) Return-Type Deduction
decltype(auto) Deducing Types Using decltype Semantics
Afterword: Looking Back and Looking Forward
Glossary
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Bibliography
Index
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z