GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Home
  • News
  • Articles
  • Recipes
  • Guides
  • Lists
  • About
  • Privacy
  • on X
  • RSS Feed

This view

  • Original page
  • New address

GeezerVison is showing hackingcpp.com — C++ Cheat Sheets & Infographics

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 C++ standard library visual overview of algorithms for finding single elements in sequences C++ 20/23 standard library visual overview of algorithms for finding single elements in sequences C++ standard library visual overview of algorithms for finding runs of equivalent elements in sequences C++ standard library visual overview of algorithms for finding subranges in sequences C++ standard library visual overview of algorithms for comparing ranges C++ standard library visual overview of algorithms for finding smallest and largest elements in sequences C++ standard library visual overview of algorithms for binary searches in sorted sequences C++20 standard library visual overview of algorithms for binary searches in sorted sequences C++ standard library visual overview of sequence structure query algorithms C++ standard library visual overview of sequence structure query algorithms C++ standard library visual overview of range traversal algorithms

Copying / Sampling / Moving

C++ standard library visual overview of range copy algorithms C++ standard library visual overview of range copy algorithms C++ standard library visual overview of algorithms that move ranges of elements

Reordering Elements

C++ standard library visual overview of algorithms that shift sequences C++20 standard library visual overview algorithms that shift sequences C++ standard library visual overview of sorting algorithms C++ standard library visual overview of sorting algorithms C++ standard library visual overview of sequence partitioning algorithms C++20 standard library visual overview of sequence partitioning algorithms C++ standard library visual overview of sequence permutation algorithms C++ standard library visual overview of algorithms for array-based heap operations C++20 standard library visual overview of algorithms for array-based heap operations

Modifying Elements

C++ standard library visual overview of algorithms for modifying range elements C++20 standard library visual overview of algorithms for modifying range elements C++ standard library visual overview of algorithms for replacing range elements C++ standard library visual overview of algorithms for removing range elements C++20 standard library visual overview of algorithms for removing range elements C++ standard library visual overview of operations on sorted sequences C++20 standard library visual overview of operations on sorted sequences

Numeric Operations

C++ standard library visual overview of numeric reduction algorithms C++ standard library visual overview of numeric scan algorithms

Standard 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

Composable Range Views Ranges C++20/23

standard library range views overview sheet with visual examples
  • Range Views Introduction
  • Range Views Overview Page

Standard Containers

std:: Sequence Containers

standard library sequence containers overview
  • Standard Library Sequence Containers Overview

std::vector<ValueType>

std::vector interface visual overview
  • std::vector Beginner's Introduction
  • std::vector Full Overview

std::deque<ValueType>

std::deque interface visual overview
  • Standard Sequence Containers Overview

std::list<ValueType>

std::list interface visual overview
  • Standard Sequence Containers Overview

std::forward_list<ValueType> std::forward_list<T>

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<KeyType,Compare>

std::set / std::multiset interface visual overview
  • Associative Containers Introduction

std::map<KeyType,MappedType,KeyCompare>

std::map / std::multimap interface visual overview
  • Associative Containers Introduction

std::unordered_set<KeyType,Hash,KeyEqual>

std::unordered_set / std::unordered_multiset interface visual overview
  • Associative Containers Introduction

std::unordered_map<KeyType,MappedType,Hash,KeyEqual>

std::unordered_map / std::unordered_multimap 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<int> w {0,1,2,3,4};
w.reserve(8);
simplified std::vector memory layout

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 Utilities

std::numeric_limits<T>

std::numeric_limits values and binary number representations 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
  • C++ Core Guidelines Cheatsheet(s)

  • Bash Cheat Sheet
  • VIM Cheat Sheet

  • git Branching  (Cheat Sheet)
  • git Revisions  (Cheat Sheet)
  • git Tricks  (Cheat Sheet)
  • tig Commands  (Cheat Sheet)

Last updated: 2023-02-19

Found this useful? Share it:

Comments…

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.