All Vocabulary Types

All Vocabulary Types

A compact index of common standard vocabulary types used to express optionality, alternatives, errors, ownership, views, and generic values.

How to use this reference page

Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.

  • Scan the top of the page first to identify the primary types, functions, or algorithm families involved.
  • Use the nearby-page links when your question is really about a companion header, related algorithm family, or broader subsystem.
  • Validate tricky behavior with a small compileable example before relying on memory for details like invalidation, ordering, allocation, or lifetime rules.

All Vocabulary Types

Optional, alternative, and error-carrying values

Generic holders and callable/value wrappers

Text and range views

Ownership and lifetime vocabulary

Error and source context vocabulary

Practical rules

Example in practice

#include <optional>

std::optional<int> result(bool ok) {
    return ok ? std::optional<int>{42} : std::nullopt;
}