20 — Grounding and References
20 — Grounding and References
This guide is intentionally compact, so it omits many edge cases. Use these references when you want the precise language-lawyer version.
Primary References
- C++ Core Guidelines — best-practice guidance from the C++ community.
- cppreference: C++ language — detailed language reference.
- cppreference: C++ standard library — detailed standard library reference.
- ISO C++ — official C++ community site and standards information.
Core Topics
- RAII
- Object lifetime
- Rule of three/five/zero
- Move constructor
- Move assignment
- Value categories
- Undefined behavior
Ownership and Memory
Containers, Algorithms, and Views
std::vectorstd::arraystd::mapstd::unordered_map- Algorithms library
std::optionalstd::variantstd::string_viewstd::spanstd::filesystemstd::chronostd::expected
Concurrency
Tooling
- CMake Tutorial
- GDB Documentation
- LLDB Documentation
- Clang AddressSanitizer
- Clang UndefinedBehaviorSanitizer
- Clang ThreadSanitizer
- clang-format
- clang-tidy
- GoogleTest
- Catch2
Compiler Verification
The examples were checked with a small verification harness in the repository:
tools/verify-cpp-guide/
Positive examples compile and run under GCC 15.2.1 with C++20. The std::expected example compiles and runs under C++23. The intentionally unsafe examples in the undefined-behavior section were checked separately with Clang 21.1.8 and AddressSanitizer/UndefinedBehaviorSanitizer.
Run it locally with:
cd tools/verify-cpp-guide
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j
./build/verify_cpp_guide
./build/expected_cpp23
Accuracy Notes
- C++ has multiple valid styles depending on domain. Embedded, finance, game engines, safety-critical software, and application backends often make different choices around exceptions, allocation, RTTI, templates, and standard library usage.
- The guide defaults to mainstream modern C++17/20 style: RAII, standard containers, value semantics, explicit ownership, CMake, tests, and sanitizers.
- Some C++23 features, especially
std::expected, may require a recent compiler and standard library. - Modules and coroutines are important but intentionally not emphasized in the recovery path because adoption and usefulness vary by codebase.