К курсам
AI013 Профессиональное

Современный курс по C++

Этот учебник призван предоставить опытным разработчикам краткую справку по новым функциям C++11/14/17/20. Охватывает улучшения удобства использования языка, повышение производительности во время выполнения, новые контейнеры, умные указатели и управление памятью, регулярные выражения, параллельное программирование и обзор C++20.

4.8
30.0h
318 учеников
10 lessons
2 лайки
Искусственный интеллект
Начать обучение

Обзор курса

📚 Краткое содержание

Этот учебник предназначен для опытных разработчиков и служит краткой справкой по новым возможностям языка C++11/14/17/20. В материале рассматриваются улучшения удобства использования языка, повышение производительности во время выполнения, использование новых контейнеров, умные указатели и управление памятью, регулярные выражения, параллельное программирование, а также обзор языковых возможностей C++20.

Быстро освойте возможности C++11/14/17/20 и пройдите порог современного программирования на языке С++.

Автор: Оу Чанькун (Ou Changkun)

Благодарности: Лицензировано по лицензии CC BY-NC-ND 4.0, благодарность всем участникам проекта на GitHub и связанным сообществам.

🎯 Цели обучения

  1. Определить и проверить среду компиляции C++ и целевую архитектуру с помощью командной строки.
  2. Объяснить совместимость стандартов и исторические пересечения между языками С (C89, C99, C11) и С++ (С++98, С++1x).
  3. Реализовать функциональную межязыковую связь с использованием заголовочных файлов extern "C" и многоэтапных процессов компиляции.
  4. Устранить неоднозначность указателей с помощью nullptr и реализовать логику на этапе компиляции с помощью constexpr и if constexpr.
  5. Упростить сложные объявления с помощью auto, decltype и псевдонимов типов (using), одновременно обеспечив надёжный объектно-ориентированный дизайн с помощью override и final.
  6. Разработать высоконагрузочные универсальные алгоритмы с помощью переменных шаблонов, выражений свёртки и вывода параметров шаблонов без типа.
  7. Определить и реализовать выражения-ламбды с различными режимами захвата (по значению, по ссылке, по выражению, по общему виду).
  8. Использовать std::function и std::bind для создания гибких обёрток функций и частичного применения функций.
  9. Классифицировать выражения как л-значения (Lvalues), промежуточные значения (Prvalues) и временные значения (Xvalues), применяя семантику перемещения для оптимизации управления ресурсами классов.
  10. Отличать модели памяти и области применения std::array (фиксированный размер, стек) и std::vector (динамический размер, куча).

Уроки

Lesson

This lesson explores the evolution of C++ and the importance of adopting modern, type-safe coding practices over legacy C-style habits. Students will learn to utilize explicit casting operators and compiler diagnostics to improve code stability, security, and performance.

This lesson explores modern C++ language usability by addressing the "NULL Trap" through the introduction of `nullptr` and examining how `constexpr` and `noexcept` shift computation and error handling to compile-time. Students will learn to improve code safety and performance by replacing legacy C-style macros and casts with modern, type-safe alternatives.

This lesson explores performance optimization in modern C++ through move semantics, lambda expressions, and efficient memory management. Students will learn to leverage zero-cost abstractions like std::array and SFINAE to improve code performance and type safety in resource-constrained environments.

This lesson explores the transition from legacy C-style arrays to the modern std::array, highlighting how the latter provides type safety and STL integration without sacrificing performance. Students will learn to leverage stack-based memory allocation, bounds-checking, and perfect forwarding to write more efficient and robust C++ code.

This lesson explores the pitfalls of manual memory management, such as memory leaks and dangling pointers, and introduces RAII (Resource Acquisition Is Initialization) as a safer, automated alternative. Students will learn how to utilize smart pointers like std::unique_ptr, std::shared_ptr, and std::weak_ptr to ensure deterministic resource cleanup and exception safety in modern C++.

This lesson explores the transition from imperative, manual string searching to declarative pattern matching using regular expressions and formal grammars. Students will learn to apply regex metacharacters and anchors to efficiently parse unstructured data while understanding the performance benefits of using Deterministic Finite Automata.

This lesson explores the transition to standardized concurrency in C++11, which introduced a formal memory model and native thread support to replace platform-specific APIs. Students will learn to manage thread lifecycles, ensure cross-platform data consistency with standardized types, and use the noexcept specifier to maintain program stability in multi-threaded environments.

This lesson explores the evolution of C++ from platform-specific coding to a unified, high-level abstraction layer, focusing on the transition from legacy macros to modern standards. Students will learn to leverage C++11 concurrency features and C++23 filesystem utilities to write portable, maintainable code that avoids OS-specific dependencies.

This lesson explores modernizing C++ development by transitioning from platform-specific APIs to standardized, high-level abstractions like task-based parallelism and the C++11 memory model. Students will learn to improve code maintainability and safety by utilizing features such as std::future, std::atomic, and extended integer types like long long int.

This lesson explores the evolution of C++20, focusing on the "Big Four" features—Concepts, Modules, Coroutines, and Ranges—that shift the language toward a more declarative and efficient programming model. Students will learn how these tools improve code safety, reduce build times, and replace complex template metaprogramming with clearer, constrained syntax.