Expert C++
Become a proficient programmer by learning coding best practices with C++17 and C++20's latest features
Vardan Grigoryan, Shunguang Wu
- 606 páginas
- English
- ePUB (apto para móviles)
- Disponible en iOS y Android
Expert C++
Become a proficient programmer by learning coding best practices with C++17 and C++20's latest features
Vardan Grigoryan, Shunguang Wu
Información del libro
Design and architect real-world scalable C++ applications by exploring advanced techniques in low-level programming, object-oriented programming (OOP), the Standard Template Library (STL), metaprogramming, and concurrency
Key Features
- Design professional-grade, maintainable apps by learning advanced concepts such as functional programming, templates, and networking
- Apply design patterns and best practices to solve real-world problems
- Improve the performance of your projects by designing concurrent data structures and algorithms
Book Description
C++ has evolved over the years and the latest release – C++20 – is now available. Since C++11, C++ has been constantly enhancing the language feature set. With the new version, you'll explore an array of features such as concepts, modules, ranges, and coroutines. This book will be your guide to learning the intricacies of the language, techniques, C++ tools, and the new features introduced in C++20, while also helping you apply these when building modern and resilient software.
You'll start by exploring the latest features of C++, and then move on to advanced techniques such as multithreading, concurrency, debugging, monitoring, and high-performance programming. The book will delve into object-oriented programming principles and the C++ Standard Template Library, and even show you how to create custom templates. After this, you'll learn about different approaches such as test-driven development (TDD), behavior-driven development (BDD), and domain-driven design (DDD), before taking a look at the coding best practices and design patterns essential for building professional-grade applications. Toward the end of the book, you will gain useful insights into the recent C++ advancements in AI and machine learning.
By the end of this C++ programming book, you'll have gained expertise in real-world application development, including the process of designing complex software.
What you will learn
- Understand memory management and low-level programming in C++ to write secure and stable applications
- Discover the latest C++20 features such as modules, concepts, ranges, and coroutines
- Understand debugging and testing techniques and reduce issues in your programs
- Design and implement GUI applications using Qt5
- Use multithreading and concurrency to make your programs run faster
- Develop high-end games by using the object-oriented capabilities of C++
- Explore AI and machine learning concepts with C++
Who this book is for
This C++ book is for experienced C++ developers who are looking to take their knowledge to the next level and perfect their skills in building professional-grade applications.
Preguntas frecuentes
Información
Section 1: Under the Hood of C++ Programming
- Chapter 1, Introduction to Building C++ Applications
- Chapter 2, Low-Level Programming with C++
- Chapter 3, Details of Object-Oriented Programming
- Chapter 4, Understanding and Designing Templates
- Chapter 5, Memory Management and Smart Pointers
Introduction to Building C++ Applications
- Introduction to C++20
- Details of the C++ preprocessor
- Under the hood of the source code compilation
- Understanding the linker and its functionality
- The process of loading and running an executable file
Technical requirements
Introduction to C++20
Concepts
template <default_constructible T>
void make_T() { return T(); }
Coroutines
- co_await suspends the execution of the coroutine.
- co_yield suspends the execution of the coroutine while also returning a value.
- co_return is similar to the regular return keyword; it finishes the coroutine and returns a value. Take a look at the following classic example:
generator<int> step_by_step(int n = 0) {
while (true) {
co_yield n++;
}
}
Ranges
import <vector>
int main()
{
std::vector<int> elements{0, 1, 2, 3, 4, 5, 6};
}
import <vector>
import <ranges>
int main()
{
std::vector<int> elements{0, 1, 2, 3, 4, 5, 6};
for (int current : elements | ranges::view::filter([](int e) { return
e % 2 == 0; }))
{
std::cout << current << " ";
}
}
More C++20 features
- The spaceship operator: operator<=>(). The verbosity of operator overloading can now be controlled by leveraging operator<=&g...