https://hackingcpp.com/cpp/cheat_sheets.html
h/cpp
h/cpp
hacking C++
News
Learning
Beginner's Guide to C++
---------------------------------------------------------------------
Standard Library Containers Standard Library Algorithms
---------------------------------------------------------------------
Cheat Sheets / Infographics All Recipes All Articles
---------------------------------------------------------------------
Online Learning Books
Links
Community Resources Tools Ecosystem
---------------------------------------------------------------------
All Resource Lists
---------------------------------------------------------------------
VIM Plugins
About
Why & Who Privacy
[ ]
Collapse All Levels Collapse Top Level Expand Top Level Expand All
Levels
---------------------------------------------------------------------
News Articles Recipes Beginner's Guide to C++ Lists
---------------------------------------------------------------------
@hackingcpp RSS Feed About Privacy Home
Cheat Sheets & Infographics Cheat Sheets & Infographics Cheat Sheets
Standard Algorithms
Quick Overview
standard library algorithms overview sheet with visual examples for
many algorithms
* Algorithms Overview Page
* C++20 Single Range Object Algorithms Overview Page
Algorithms Gallery...
Non-Modifying Operations
C++ standard library visual overview of existence query algorithms
alt= alt= alt= alt= alt= alt= alt= alt= alt= alt=
Copying / Sampling / Moving
alt= alt= alt=
Reordering Elements
alt= alt= alt= alt= alt= alt= alt= alt= alt=
Modifying Elements
alt= alt= alt= alt= alt= alt= alt=
Numeric Operations
alt= alt=
Standard Randomness
Standard Random Distributions C++11
an overview of standard library random distribution types
* Random Number Generation
* Random Distributions
Standard Random Sampling Distributions C++11
an overview of standard library random distribution types
* Random Distributions
Standard Sequence Views
std::span C++20
std::span contiguous sequence view interface and usage cheat sheet
* std::span / gsl::span
std::string_view C++17
std::string_view interface and usage cheat sheet
* Standard Sequence Views
Standard Containers
std:: Sequence Containers
standard library sequence containers overview
* Standard Library Sequence Containers Overview
std::vector
std::vector interface visual overview
* std::vector Beginner's Introduction
* std::vector Full Overview
std::deque
std::deque interface visual overview
* Standard Sequence Containers Overview
std::list
std::list interface visual overview
* Standard Sequence Containers Overview
std::forward_list std::forward_list
std::forward_list interface visual overview
* Standard Sequence Containers Overview
std::string Interface & Utilities Overview
std::string interface overview cheat sheet
* String Basics...
* Which Function Parameter For Strings?
std:: Associative Containers
standard library associative containers overview
* Associative Containers Introduction
std::set
std::set / std::multiset interface visual overview
* Associative Containers Introduction
std::unordered_set
std::unordered_set / std::unordered_multiset interface visual
overview
* Associative Containers Introduction
std:: Special Containers
standard library special containers overview
* Special Containers Introduction
Iterators
example: iterators in C++
Iterator Range
iterator range convention: pair of iterators
end-of-range iterator q points one behind the last element in the
range
Iterator Range Examples
examples of various iterator ranges
Which Sequence Container Should I Use?
flowchart for selecting an appropriate standard library container
vector Growth Scheme
example of growing a std::vector works internally
vector Memory Layout (typical)
Example: vector object w on the stack
vector w {0,1,2,3,4};
w.reserve(8);
simplified std::vector memory layout
Standard Utilities
std::numeric_limits
std::numeric_limits values and binary number represenatations for
signed integers, unsigned integers and floating point numbers
* Fundamental Types...
Language Rules & Mechanisms
Build Model / Compiling A Project
separate compilation example
* Separate Compilation, Preprocessor, ...
The "Usual Arithmetic Conversions"
Summary of the arithmetic type conversion rules incl. integer
promotion and conversion rules.
* Fundamental Types & Operations ...
Lambda Expressions
lambda expressions syntax & semantics overview
* Introduction To Function Objects...
* Lambda Basics...
Lambda Expression Syntax
allowed lambda expression syntax in different C++ standards
Variables in C++
variable = named object = set of bits interpreted according to a type
---------------------------------------------------------------------
* Fundamental Types
Reference Binding Rules
reference binding rules
---------------------------------------------------------------------
* References
* Move Semantics & rvalue References
Reference Collapsing C++11
for template arguments
reference collapsing rules
---------------------------------------------------------------------
* Move Semantics & rvalue References
* Perfect Forwarding
Perfect Forwarding C++11
of template arguments Forwarding
example of the perfect forwarding idiom
---------------------------------------------------------------------
* Perfect Forwarding
Non-Standard Libraries
{fmt} v8.0 - Printing & Formatting
example-based overview of formatting and printing with the {fmt}
library
* {fmt} Library Introduction & Overview
{fmt} v8.0 - Time & Date Formatting
time/date formatting string tokens as used by the {fmt} library,
std::format and std::strftime
std::format and std::strftime use the same formatting tokens
Design Guidelines
Function Parameters & Return Values Fn Interfaces C++17
cheat sheet about what function parameter types and return types to
use
* prefer specific types over general-purpose types
* don't use getter/setter pairs for classes
* use descriptive action names (`verbs') for mutating member
functions
* avoid direct mutable access to class member variables from the
outside
* Design Study: Function Interfaces
String(-Like) Function Parameters
cheat sheet about what type to use for string-like functions
parameters
* More...
Don't Throw Exceptions in Destructors!
Parent (of type A) gets destroyed and the destructor of one child
(type B) throws an exception = resources may leak!
example showing why throwing destructors are bad
* More...
Engineering
Binary Representations of Numeric Values
binary representations of numeric values: unsigned integers, signed
integers and IEEE 754 floating point numbers
Terminology
Function Contracts
overview of function contract terminology: preconditions,
postconditions, invariants, side effects
Related ...
* Vast Collection of Cheat Sheets (by Alexander Krassotkin)
* Rico's Cheat Sheets (for tools & languages)
* Wizard Zines - Nice Cheat Sheets and Posters (by Julia Evens)
* Quickref.me - Cheat Sheet Collection
---------------------------------------------------------------------
* Bash Cheat Sheet
* VIM Cheat Sheet
---------------------------------------------------------------------
* git Branching (Cheat Sheet)
* git Revisions (Cheat Sheet)
* git Tricks (Cheat Sheet)
* tig Commands (Cheat Sheet)
Last updated: 2022-02-25
Found this useful? Share it:
Comments...
* Home
* News
* Articles
* Recipes
* Guides
* Lists
* About
* Privacy
* Twitter
* RSS Feed
Tags
* algorithms
* allocators
* arrays
* article
* beginner-level
* blogs
* books
* build-systems
* C++
* C++-standardization
* C++11
* C++14
* C++17
* C++20
* C++98
* C-style
* C-vs-C++
* casts
* classes
* code-editors
* code-formatters
* code-trans
* command-line
* community
* comparisons
* compilers
* concepts
* conferences
* const
* constexpr
* containers
* control-flow
* CUDA
* custom-types
* data-structures
* debugging
* design
* diagnostics
* exceptions
* file-io
* find
* find_if
* functional-prog
* functions
* gallery
* generic-prog
* groups
* guide
* guidelines
* hash-map
* hash-set
* hashing
* header-files
* heap
* ides
* idiom
* initialization
* input
* io
* iostreams
* iterators
* lambda
* language-mechanism
* language-references
* learning
* libraries
* library
* linker
* list
* low-level
* map
* memory
* modern-C++
* move-semantics
* news
* oop
* organizations
* output
* package-manager
* paradigm
* pattern
* people
* performance
* podcasts
* pointers
* preprocessor
* profiling
* Python
* randomness
* ranges
* recipe
* references
* set
* social-media
* stack
* standardization
* std-algorithms
* std-containers
* std-library
* std-macros
* std-vector
* STL
* strings
* style
* taste
* templates
* testing
* toolchain
* tools
* traversal
* types
* user
* version-control
* views
* VIM
* VIM-plugins
* warnings
* websites
(c) 2019-2022 Andre Muller