Named Requirements
The named requirements listed on this page are the named requirements used in the normative text of the C++ standard to define the expectations of the standard library.
Some of these requirements are being formalized in C++20 using the concepts language feature. Until then, the burden is on the programmer to ensure that library templates are instantiated with template arguments that satisfy these requirements. Failure to do so may result in very complex compiler diagnostics.
Basic
pub | DefaultConstructible | specifies that an object of the type can be default constructed |
pub | MoveConstructible(C++11) | specifies that an object of the type can be constructed from rvalue |
pub | CopyConstructible | specifies that an object of the type can be constructed from lvalue |
pub | MoveAssignable(C++11) | specifies that an object of the type can be assigned from rvalue |
pub | CopyAssignable | specifies that an object of the type can be assigned from lvalue |
pub | Destructible | specifies that an object of the type can be destroyed |
Type properties
Note: the standard does not define named requirements with names specified in this subcategory. These are type categories defined by the core language. They are included here as named requirements only for consistency.
pub | ScalarType | object types that are not array types or class types |
pub | PODType (deprecated in C++20) | POD (Plain Old Data) types, compatible with C struct |
pub | TriviallyCopyable(C++11) | objects of these types can maintain their values after copying their underlying bytes |
pub | TrivialType(C++11) | objects of these types can be trivially constructed and copied |
pub | StandardLayoutType(C++11) | these types are useful for communicating with code written in other programming languages |
pub | ImplicitLifetimeType | objects of these types can be implicitly created, and their lifetimes can be implicitly started |
Library-wide
pub | EqualityComparable | operator== is an equivalence relation |
pub | LessThanComparable | operator< is a strict weak ordering relation |
pub | Swappable | can be swapped with an unqualified non-member function call swap() |
pub | ValueSwappable(C++11) | a LegacyIterator that dereferences to a Swappable type |
pub | NullablePointer(C++11) | a pointer-like type supporting a null value |
pub | Hash(C++11) | a FunctionObject that for inputs with different values has a low probability of giving the same output |
pub | Allocator | a class type that contains allocation information |
pub | FunctionObject | an object that can be called with the function call syntax |
pub | Callable | a type for which the invoke operation is defined |
pub | Predicate | a FunctionObject that returns a value convertible to bool for one argument without modifying it |
pub | BinaryPredicate | a FunctionObject that returns a value convertible to bool for two arguments without modifying them |
pub | Compare | a BinaryPredicate that establishes an ordering relation |
Container
pub | Container | data structure that allows element access using iterators |
pub | ReversibleContainer | container using bidirectional iterators |
pub | AllocatorAwareContainer(C++11) | container using an allocator |
pub | SequenceContainer | container with elements stored linearly |
pub | ContiguousContainer(C++17) | container with elements stored at adjacent memory addresses |
pub | AssociativeContainer | container that stores elements by associating them to keys |
pub | UnorderedAssociativeContainer(C++11) | container that stores elements stored in buckets by associating them to keys |
Container element
pub | DefaultInsertable(C++11) | element can be default-constructed in uninitialized storage |
pub | CopyInsertable(C++11) | element can be copy-constructed in uninitialized storage |
pub | MoveInsertable(C++11) | element can be move-constructed in uninitialized storage |
pub | EmplaceConstructible(C++11) | element can be constructed in uninitialized storage |
pub | Erasable(C++11) | element can be destroyed using an allocator |
Iterator
pub | LegacyIterator | general concept to access data within some data structure |
pub | LegacyInputIterator | iterator that can be used to read data |
pub | LegacyOutputIterator | iterator that can be used to write data |
pub | LegacyForwardIterator | iterator that can be used to read data multiple times |
pub | LegacyBidirectionalIterator | iterator that can be both incremented and decremented |
pub | LegacyRandomAccessIterator | iterator that can be advanced in constant time |
pub | LegacyContiguousIterator(C++17) | iterator to contiguously-allocated elements |
pub | ConstexprIterator(C++20) | iterator that can be used during constant expression evaluation |
Stream I/O functions
pub | UnformattedInputFunction | a stream input function that does not skip leading whitespace and counts the processed characters |
pub | FormattedInputFunction | a stream input function that skips leading whitespace |
pub | UnformattedOutputFunction | a basic stream output function |
pub | FormattedOutputFunction | a stream output function that sets failbit on errors and returns a reference to the stream |
Formatters
pub | BasicFormatter(C++20) | abstracts formatting operations for a given formatting argument type and character type |
pub | Formatter(C++20) | defines functions used by the formatting library |
Random Number Generation
pub | SeedSequence(C++11) | consumes a sequence of integers and produces a sequence of 32-bit unsigned values |
pub | UniformRandomBitGenerator(C++11) | returns uniformly distributed random unsigned integers |
pub | RandomNumberEngine(C++11) | a deterministic UniformRandomBitGenerator, defined by the seed |
pub | RandomNumberEngineAdaptor(C++11) | a RandomNumberEngine that transforms the output of another RandomNumberEngine |
pub | RandomNumberDistribution(C++11) | returns random numbers distributed according to a given mathematical probability density function |
Concurrency
pub | BasicLockable(C++11) | provides exclusive ownership semantics for execution agents (i.e. threads) |
pub | Lockable(C++11) | a BasicLockable that supports attempted lock acquisition |
pub | TimedLockable(C++11) | a Lockable that supports timed lock acquisition |
pub | SharedLockable(C++14) | provides shared ownership semantics for execution agents (i.e. threads) |
pub | SharedTimedLockable(C++14) | a SharedLockable that supports timed lock acquisition |
pub | Mutex(C++11) | a Lockable that protects against data races and sequentially consistent synchronization |
pub | TimedMutex(C++11) | a TimedLockable that protects against data races and sequentially consistent synchronization |
pub | (C++17) | a Mutex that supports shared ownership semantics |
pub | SharedTimedMutex(C++14) | a TimedMutex that supports shared ownership semantics |
Ranges
pub | RangeAdaptorObject(C++20) | a FunctionObject that creates a range adaptor from a viewable_range and additional arguments |
pub | RangeAdaptorClosureObject(C++20) | a FunctionObject that supports the pipe operator |
Other
pub | UnaryTypeTrait(C++11) | describes a property of a type |
pub | BinaryTypeTrait(C++11) | describes a relationship between two types |
pub | TransformationTrait(C++11) | modifies a property of a type |
pub | Clock(C++11) | aggregates a duration, a time point, and a function to get the current time point |
pub | TrivialClock(C++11) | a Clock that does not throw exceptions |
pub | CharTraits | defines types and functions for a character type |
pub | BitmaskType | bitset, integer, or enumeration |
pub | NumericType | a type for which initialization is effectively equal to assignment |
pub | RegexTraits(C++11) | defines types and functions used by the regular expressions library |
pub | LiteralType(C++11) | a type with constexpr constructor |