04 / Leitfäden
Modernes C++-Recovery-Handbuch
Modern C++ Recovery Guide
Ein kurzes, praktisches Wiki für jemanden, der etwa 2008 C++ gelernt hat und schnell wieder in modernes C++17/20 einsteigen möchte.
Wie man dieses Wiki benutzt
Gehe die Seiten in der vorgegebenen Reihenfolge durch. Versuche nicht, alles auswendig zu lernen. Für jedes Thema solltest du verstehen:
- Welches Problem wird damit gelöst?
- Was bevorzugt modernes C++?
- Was sind die üblichen Fehlermodi?
- Kann ich aus dem Gedächtnis ein kleines Beispiel schreiben?
Empfohlener Pfad
Phase 1 — Kern neu aufbauen
- Mental Model: Modern C++
- Compilation, Linking, and Project Shape
- Object Lifetime, Stack, Heap, and RAII
- Ownership, Raw Pointers, and Smart Pointers
- Value Semantics and Rule of 0/3/5
Phase 2 — Moderne Sprachfeatures
- Move Semantics
- Const, References, and Parameter Passing
- STL Containers and Algorithms
- Modern Syntax: auto, Lambdas, enum class, constexpr
- Optional, Variant, String View, Span, Filesystem, Chrono
- Templates and Generic Programming
Phase 3 — Ernsthaftes C++
- Error Handling and Exception Safety
- Concurrency: Threads, Mutexes, Atomics
- Undefined Behavior and Memory Safety
- Performance Fundamentals
- Tooling: CMake, Debuggers, Sanitizers, Testing
Phase 4 — Einen Anwendungsbereich wählen
Schnellster Praktischer Plan
Wenn Sie einen 30‑Tage‑Sprint planen:
- Woche 1: RAII, Besitz, Smart Pointers, Wertsemantik.
- Woche 2: Move‑Semantik, STL, Lambdas, moderne Syntax.
- Woche 3: CMake, Debugging, Sanitizer, Tests, Grundlagen der Parallelität.
- Woche 4: ein ernsthaftes Projekt erstellen.
Standard-Ziel-Stack
Wenn Sie nicht wissen, wo Sie anfangen sollen, streben Sie an:
C++17/20 + Linux + CMake + gdb/lldb + sanitizers + GoogleTest/Catch2 + Python zur Automatisierung.
Diese Kombination bietet Ihnen eine langlebige technische Grundlage und hält Sie produktiv.
Grundlagen
Dies ist ein kurzer Wiederherstellungsleitfaden, kein Ersatz für den Standard oder ein vollständiges Lehrbuch. Für autoritative Referenzen und Versionshinweise siehe Grounding and References.
01 — Modern C++ Mental Model
Modern C++ is not “C with classes.” It is a language for building efficient systems using explicit ownership, deterministic cleanup, value semantics, and z
02 — Compilation, Linking, and Project Shape
C++ is usually built in separate translation units. Understanding the build process saves hours of confusion.
03 — Object Lifetime, Stack, Heap, and RAII
C++ is a lifetime language. To write good C++, you must know when objects are created, when they are destroyed, and who owns resources.
04 — Ownership, Raw Pointers, and Smart Pointers
Modern C++ code should make ownership obvious.
05 — Value Semantics and Rule of 0/3/5
Modern C++ prefers types that behave like values. A good type can be copied, moved, stored in containers, returned from functions, and destroyed safely.
06 — Move Semantics
Move semantics let C++ transfer resources instead of copying them.
07 — Const, References, and Parameter Passing
Function signatures should communicate ownership, mutation, and optionality.
08 — STL Containers and Algorithms
The standard library is the default toolbox. Modern C++ code should use containers and algorithms instead of manual memory and hand-written loops everywher
09 — Modern Syntax: auto, Lambdas, enum class, constexpr
Use `auto` when the type is obvious or verbose.
10 — Modern Library Types
Use when a value may or may not exist.
11 — Templates and Generic Programming
Templates let you write code that works with many types while still being compiled into efficient type-specific code.
12 — Error Handling and Exception Safety
C++ has multiple error handling styles. The right one depends on the domain.
13 — Concurrency: Threads, Mutexes, Atomics
Concurrent code lets multiple things happen at once, but introduces data races, deadlocks, ordering issues, and debugging pain.
14 — Undefined Behavior and Memory Safety
Undefined behavior means the C++ standard places no requirements on what happens. The program may appear to work, crash, corrupt data, or become vulnerable
15 — Performance Fundamentals
C++ gives you control over performance, but you must measure. Guessing is unreliable.
16 — Tooling: CMake, Debuggers, Sanitizers, Testing
Modern C++ skill includes tooling. Real C++ work is not just language syntax.
17 — Domain Tracks
C++ becomes most valuable when attached to a serious domain. Do not learn endless syntax in isolation.
18 — Project Ideas
A serious project beats passive study. Pick one project that forces you to use modern C++ features, tooling, debugging, and domain concepts.
19 — Quick Checklist
Use this as a fast self-assessment.
20 — Grounding and References
Authoritative references used to ground the Modern C++ Recovery Guide.