C++ CPP cheat sheet
C++ CPP · Keep the key ideas within reach.
C++ standard containers, iterators and algorithm contracts
Choose containers by actual operations and invalidation rules.
Respect half-open ranges and required iterator categories.
Remove/unique do not themselves erase container storage.
Sorting/searching and complexity claims require explicit preconditions.
C++ templates, callable objects, streams and exceptions
Template deduction follows the declared parameter relationships.
Value/reference capture and move casts do not imply identical side effects.
Stream formatting and failure state require actual context.
Reference catching and bare rethrow preserve different information from value copies.
C++ types, expressions, functions and control flow
Version, type, grouping and sequencing assumptions determine a trace.
Compiler output does not define undefined behavior.
Follow loop/switch control transfers explicitly.
Value, reference and pointer interfaces have distinct effects.
C++ object lifetime, ownership, classes and polymorphism
A pointer is not proof of valid lifetime or ownership.
RAII ties owned-resource cleanup to object lifetime.
Allocation/deallocation forms and polymorphic deletion must match the rules.
Virtual dispatch, hiding and access control are distinct.