Skip to content

Latest commit

 

History

History
536 lines (315 loc) · 22.4 KB

File metadata and controls

536 lines (315 loc) · 22.4 KB

The standard library, Boost and proposals

Table of contents


General information

📖

Implementations

🔗


Algorithms

🎥

std::iota

🔗

std::midpoint

🎥


Containers

🎥

Associative containers

Associative containers are: std::set (collection of unique keys, sorted by keys), std::map (collection of key-value pairs, sorted by keys, keys are unique), std::multiset (collection of keys, sorted by keys), and std::multimap (collection of key-value pairs, sorted by keys).

🔗

Sequence containers

Sequence containers are: std::array (static contiguous array), std::vector (dynamic contiguous array), std::deque (double-ended queue), std::forward_list (singly-linked list), and std::list (doubly-linked list).

std::array

🔗

std::deque

🔗

std::vector

🔗

std::vector<bool>

🔗

Unordered containers

Unordered containers are: std::unordered_set (collection of unique keys, hashed by keys), std::unordered_map (collection of key-value pairs, hashed by keys, keys are unique), std::unordered_multiset (collection of keys, hashed by keys), and std::unordered_multimap (collection of key-value pairs, hashed by keys).

🔗

🎥


Input/output

🔗


Iterators

🔗

🎥


Memory

See also Memory and cache – Optimization and hardware.

Allocators


Numerics

std::bit_cast

Linear algebra support

🔗

V.Reverdy. On vectors, tensors, matrices, and hypermatrices

🎥

Random numbers

🔗

🎥


Regular expressions

🔗

🎥


Smart pointers

A smart pointer is a class that simulates a raw C++ pointer, and provides automatic exception-safe object lifetime management.

🔗

🎥

std::unique_ptr

The std::unique_ptr class is a smart pointer with unique ownership.

🔗

std::shared_ptr

The std::unique_ptr class is a smart pointer with shared ownership.

🔗

std::enable_shared_from_this

std::enable_shared_from_this allows a member function of an object that is currently managed by a std::shared_ptr to extend the lifetime of that object dynamically by generating additional std::shared_ptr instances.

🔗

std::weak_ptr

🔗

std::auto_ptr

std::auto_ptr is a smart pointer with unique ownership that had been designed before rvalue references and move semantics were introduced into the language. It was deprecated in C++11 and removed in C++17.

🔗

std::observer_ptr

std::observer_ptr is a smart pointer that takes no ownership responsibility for its pointees (non-owning pointer).

boost::intrusive_ptr

The boost::intrusive_ptr class is a smart pointer that stores a pointer to an object with an embedded reference count, which is managed somewhere outside the smart pointer.

🔗


Strings

📝

  • std::basic_string<T, ...> is the only container in the standard library that requires T to be a trivial standard-layout type.

🔗

Short string optimization

🔗

std::string_view

🔗

🎥


Type support

Fixed-width integer types

📝

  • std::int8_t, std::int16_t, std::int32_t, and std::int64_t are guaranteed to use 2’s complement to represent negative values.

🔗

Type traits

See also Type traits – Templates.

🎥

std::is_trivial*

🎥


Utilities

🔗

Function objects

🔗

🎥

Pairs and tuples

🔗

🎥

Sum types

std::variant

🎥

(std::)expected

A proposed utility class to represent expected monad.

🔗

std::launder

🔗


Tricks and subtleties

🔗

🎥


The Standard Template Library (STL)

🔗

📄

🎥