Skip to content
C++
HomeCheat Sheets

C++ Cheat Sheets

Quick-reference cards for the most common C++ patterns and APIs.

STL Algorithms Cheat Sheet

"Quick reference for the most commonly used STL algorithms: sort, find, transform, accumulate, ranges. With C++20 ranges equivalents."

algorithmsstlsort

std::chrono Quick Reference

C++ chrono cheat sheet — durations, clocks, time points, arithmetic, formatting, calendars (C++20), time zones, and benchmarking patterns.

chronodurationtime_point

CMake Quick Reference

CMake cheatsheet — targets, properties, find_package, FetchContent, install, generator expressions, and common patterns.

cmakebuild-systemcheatsheet

Common C++ Mistakes

Common C++ pitfalls and mistakes — dangling references, iterator invalidation, signed/unsigned comparison, UB, and memory errors.

mistakespitfallsdangling

Compile-Time Programming Quick Reference

C++ compile-time programming cheat sheet — constexpr, consteval, constinit, if constexpr, concepts, type traits, template metaprogramming, and static_assert.

constexprconstevalconcepts

C++ Concurrency Cheat Sheet

Quick reference for std::thread, mutex, atomic, condition_variable, and async in C++.

concurrencythreadmutex

STL Containers Cheat Sheet

"Quick reference for all STL containers: construction, common operations, complexity, and when to choose each."

containersstlvector

C++ Versions Quick Reference

What each C++ standard added — C++11 through C++26 key features in one reference.

cpp11cpp14cpp17

Debugging C++ — Techniques

C++ debugging techniques — sanitizers, print debugging, assertions, core dumps, watchpoints, and debugging optimized code.

debuggingsanitizersasan

C++ Error Handling Cheat Sheet

Quick reference for C++ error handling strategies — exceptions, std::expected, error codes, and when to use each.

exceptionsexpectederror-handling

Exceptions — Quick Reference

C++ exceptions cheatsheet — throw/catch/rethrow, exception hierarchy, noexcept, RAII safety, exception_ptr, and when to use vs alternatives.

exceptionsthrowcatch

std::filesystem Quick Reference

C++17 std::filesystem cheatsheet — path operations, directory traversal, file queries, copy/rename/remove, permissions, and common patterns.

filesystempathdirectory

GDB Quick Reference

GDB cheatsheet — breakpoints, watchpoints, stepping, inspecting variables, call stack, TUI mode, reverse debugging, and Python scripting.

gdbdebuggercheatsheet

Inheritance — Quick Reference

C++ inheritance cheatsheet — access specifiers, virtual dispatch, override/final, virtual destructor, abstract classes, multiple inheritance, and common pitfalls.

inheritancevirtualoverride

I/O Streams — Quick Reference

C++ I/O streams cheatsheet — cin/cout/cerr, file streams, string streams, formatting, error handling, binary I/O, and performance tips.

iostreamfstreamstringstream

Iterators Quick Reference

C++ iterator categories, requirements, traits, adapters, sentinel iterators, and C++20 ranges concepts.

iteratorsiterator-categoriesreverse_iterator

Lambdas Quick Reference

C++ lambda cheat sheet — capture lists, generic lambdas, immediately invoked lambdas, mutable, constexpr, recursive, and C++23 features.

lambdaclosurecapture

Memory Management Quick Reference

C++ memory management cheat sheet — smart pointers, allocators, placement new, RAII, memory model, and common pitfalls.

memoryRAIIsmart-pointers

Modern C++ Cheat Sheet (C++11–C++23)

Quick reference for modern C++ features by standard — auto, lambdas, move semantics, structured bindings, concepts, and more.

C++11C++14C++17

Move Semantics Quick Reference

C++ move semantics cheatsheet — rvalue references, std::move, std::forward, Rule of Five, move-only types, and perfect forwarding patterns.

move-semanticsrvaluestd::move

OOP Quick Reference

C++ OOP cheatsheet — classes, access control, inheritance, virtual functions, abstract classes, and Rule of Five summary.

OOPclassinheritance

Pointers and References Quick Reference

C++ pointers and references cheatsheet — raw pointers, references, pointer arithmetic, const correctness, nullptr, and smart pointer overview.

pointersreferencesconst

C++ Ranges Cheat Sheet

Quick reference for C++20 std::ranges algorithms, views, and pipeline composition.

rangesviewsC++20

std::regex Quick Reference

C++ regex cheat sheet — std::regex syntax, std::regex_search/match/replace, capture groups, iterators, and performance tips.

regexregular-expressionsregex_search

Smart Pointers Cheat Sheet

"Quick reference for unique_ptr, shared_ptr, and weak_ptr: syntax, operations, and when to use each."

smart-pointersunique_ptrshared_ptr

STL Algorithms Quick Reference

Complete STL algorithms cheat sheet — sorting, searching, transforming, partitioning, set operations, and numeric algorithms with usage examples.

algorithmsSTLsort

String Formatting Quick Reference

C++ string formatting cheat sheet — std::format, std::print, format specifiers, custom formatters, and migration from printf/sprintf/ostringstream.

std::formatstd::printformatting

Templates Quick Reference

C++ templates cheat sheet — function/class/variable templates, specialization, SFINAE, concepts, fold expressions, CRTP, and template metaprogramming patterns.

templatesSFINAEconcepts

Type Traits Quick Reference

C++ type traits cheatsheet — primary type categories, type relationships, modifications, composite traits, and common patterns.

type-traitsis_sameis_integral