Named Requirements - cppreference.com (original) (raw)
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.
The burden to ensure that library templates are instantiated with template arguments that satisfy these requirements is on the programmer. Failure to do so may result in very complex compiler diagnostics.
Some of these requirements are formalized in C++20 using the concepts language feature.
| Container | |
|---|---|
| Container | data structure that allows element access using iterators(named requirement) |
| ReversibleContainer | container using bidirectional iterators(named requirement) |
| AllocatorAwareContainer(C++11) | container using an allocator(named requirement) |
| SequenceContainer | container with elements stored linearly(named requirement) |
| ContiguousContainer(C++17) | container with elements stored at adjacent memory addresses(named requirement) |
| AssociativeContainer | container that stores elements by associating them to keys(named requirement) |
| UnorderedAssociativeContainer(C++11) | container that stores elements stored in buckets by associating them to keys(named requirement) |
| Container element | |
| DefaultInsertable(C++11) | element can be default-constructed in uninitialized storage(named requirement) |
| CopyInsertable(C++11) | element can be copy-constructed in uninitialized storage(named requirement) |
| MoveInsertable(C++11) | element can be move-constructed in uninitialized storage(named requirement) |
| EmplaceConstructible(C++11) | element can be constructed in uninitialized storage(named requirement) |
| Erasable(C++11) | element can be destroyed using an allocator(named requirement) |
| Iterator | |
| LegacyIterator | general concept to access data within some data structure(named requirement) |
| LegacyInputIterator | iterator that can be used to read data(named requirement) |
| LegacyOutputIterator | iterator that can be used to write data(named requirement) |
| LegacyForwardIterator | iterator that can be used to read data multiple times(named requirement) |
| LegacyBidirectionalIterator | iterator that can be both incremented and decremented(named requirement) |
| LegacyRandomAccessIterator | iterator that can be advanced in constant time(named requirement) |
| LegacyContiguousIterator(C++17) | iterator to contiguously-allocated elements(named requirement) |
| ConstexprIterator(C++20) | iterator that can be used during constant expression evaluation(named requirement) |
| Stream I/O functions | |
| UnformattedInputFunction | a stream input function that does not skip leading whitespace and counts the processed characters(named requirement) |
| FormattedInputFunction | a stream input function that skips leading whitespace(named requirement) |
| UnformattedOutputFunction | a basic stream output function(named requirement) |
| FormattedOutputFunction | a stream output function that sets failbit on errors and returns a reference to the stream(named requirement) |
| Formatters | |
| BasicFormatter(C++20) | abstracts formatting operations for a given formatting argument type and character type(named requirement) |
| Formatter(C++20) | defines functions used by the formatting library(named requirement) |
| Random Number Generation | |
| SeedSequence(C++11) | consumes a sequence of integers and produces a sequence of 32-bit unsigned values(named requirement) |
| UniformRandomBitGenerator(C++11) | returns uniformly distributed random unsigned integers(named requirement) |
| RandomNumberEngine(C++11) | a deterministic UniformRandomBitGenerator, defined by the seed(named requirement) |
| RandomNumberEngineAdaptor(C++11) | a RandomNumberEngine that transforms the output of another RandomNumberEngine(named requirement) |
| RandomNumberDistribution(C++11) | returns random numbers distributed according to a given mathematical probability density function(named requirement) |
| Concurrency | |
| BasicLockable(C++11) | provides exclusive ownership semantics for execution agents (i.e. threads)(named requirement) |
| Lockable(C++11) | a BasicLockable that supports attempted lock acquisition(named requirement) |
| TimedLockable(C++11) | a Lockable that supports timed lock acquisition(named requirement) |
| SharedLockable(C++14) | provides shared ownership semantics for execution agents (i.e. threads)(named requirement) |
| SharedTimedLockable(C++14) | a SharedLockable that supports timed lock acquisition(named requirement) |
| Mutex(C++11) | a Lockable that protects against data races and sequentially consistent synchronization(named requirement) |
| TimedMutex(C++11) | a TimedLockable that protects against data races and sequentially consistent synchronization(named requirement) |
| SharedMutex(C++17) | a Mutex that supports shared ownership semantics(named requirement) |
| SharedTimedMutex(C++14) | a TimedMutex that supports shared ownership semantics(named requirement) |
| Ranges | |
| RangeAdaptorObject(C++20) | a FunctionObject that creates a range adaptor from a viewable_range and additional arguments(named requirement) |
| RangeAdaptorClosureObject(C++20) | a FunctionObject that supports the pipe operator(named requirement) |
| Multidimensional View Customization | |
| LayoutMapping(C++23) | controls the mapping of multidimensional index in mdspan(named requirement) |
| LayoutMappingPolicy(C++23) | a policy that holds LayoutMapping requirements(named requirement) |
| AccessorPolicy(C++23) | a policy that controls access to data handle in mdspan(named requirement) |
| Other | |
| UnaryTypeTrait(C++11) | describes a property of a type(named requirement) |
| BinaryTypeTrait(C++11) | describes a relationship between two types(named requirement) |
| TransformationTrait(C++11) | modifies a property of a type(named requirement) |
| Clock(C++11) | aggregates a duration, a time point, and a function to get the current time point(named requirement) |
| TrivialClock(C++11) | a Clock that does not throw exceptions(named requirement) |
| CharTraits | defines types and functions for a character type(named requirement) |
| BitmaskType | bitset, integer, or enumeration(named requirement) |
| NumericType | a type for which initialization is effectively equal to assignment(named requirement) |
| RegexTraits(C++11) | defines types and functions used by the regular expressions library(named requirement) |
| LiteralType(C++11) | a type with constexpr constructor(named requirement) |