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.
All Vocabulary Types
A compact index of common standard vocabulary types used to express optionality, alternatives, errors, ownership, views, and generic values.
Use reference pages to confirm names, categories, nearby facilities, and the constraints that matter before writing or reviewing code.
std::optional<T>std::variant<Ts...>std::expected<T, E>std::monostatestd::anystd::functionstd::reference_wrapper<T>std::pair<T, U>std::tuple<Ts...>std::string_viewstd::span<T>std::mdspanstd::unique_ptr<T>std::shared_ptr<T>std::weak_ptr<T>std::error_codestd::source_location#include <optional>
std::optional<int> result(bool ok) {
return ok ? std::optional<int>{42} : std::nullopt;
}