Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/named req"

From cppreference.com
< cpp
m (c++17)
(+ BooleanTestable)
 
(41 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{title|Concepts}}
+
{{title|Named Requirements}}
{{cpp/concept/navbar}}
+
{{cpp/named req/navbar}}
  
A concept is a term that describes a '''named set of requirements''' for a type. Concepts are a more convenient way to specify both what properties are expected from a type, and what properties a type has.
+
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.
  
There is [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3701.pdf a proposal] to include a formal specification of concepts into a future revision of C++. This proposal allows compilers to check type requirements ''before'' template instantiations, allowing much more sensible error messages when those types do not fulfill the template requirements. (This proposal replaces the original [http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1758.pdf C++11 concepts] proposal, which was dropped for various reasons.)
+
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.
  
Here ''concepts'' have little in common with the abovementioned proposal. They refer to informal named requirements, used in the C++03 and C++11 standards to define behavior and expected properties for various types.  
+
Some of these requirements are formalized in C++20 using the [[cpp/language/constraints|concepts]] language feature.
  
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc h1 | Basic}}
+
{{dsc h1|Basic}}
{{dsc concept | cpp/concept/DefaultConstructible | specifies that an object of the type can be default constructed}}
+
{{dsc named req|cpp/named req/DefaultConstructible|specifies that an object of the type can be default constructed}}
{{dsc concept | cpp/concept/MoveConstructible | specifies that an object of the type can be constructed from rvalue | notes={{mark c++11}}}}
+
{{dsc named req|cpp/named req/MoveConstructible|specifies that an object of the type can be constructed from rvalue|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/CopyConstructible | specifies that an object of the type can be constructed from lvalue}}
+
{{dsc named req|cpp/named req/CopyConstructible|specifies that an object of the type can be constructed from lvalue}}
{{dsc concept | cpp/concept/MoveAssignable | specifies that an object of the type can be assigned from rvalue| notes={{mark c++11}}}}
+
{{dsc named req|cpp/named req/MoveAssignable|specifies that an object of the type can be assigned from rvalue|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/CopyAssignable | specifies that an object of the type can be assigned from lvalue}}
+
{{dsc named req|cpp/named req/CopyAssignable|specifies that an object of the type can be assigned from lvalue}}
{{dsc concept | cpp/concept/Destructible | specifies that type has a destructor}}
+
{{dsc named req|cpp/named req/Destructible|specifies that an object of the type can be destroyed}}
  
{{dsc h1 | Layout}}
+
{{dsc h1|Type properties}}
{{dsc | Note, that the standard doesn't define named requirements or concepts with names specified in this subcategory. <br>These are type categories defined by the core language. They are included here as concepts only for consistency.}}
+
{{dsc|Note: the standard does not define named requirements with names specified in this subcategory. <br>These are type categories defined by the core language. They are included here as named requirements only for consistency.}}
{{dsc concept | cpp/concept/TriviallyCopyable | class with trivial copy, assignment and destructor | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/ScalarType|object types that are not array types or class types}}
{{dsc concept | cpp/concept/TrivialType | class with trivial constructors, assignment and destructor | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/PODType|POD (Plain Old Data) types, compatible with C {{c|struct}}|notes={{mark deprecated c++20}}}}
{{dsc concept | cpp/concept/StandardLayoutType | non-virtual class containing only other StandardLayout members, all with the same access control | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/TriviallyCopyable|objects of these types can maintain their values after copying their underlying bytes|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/PODType | POD (Plain Old Data) structure, compatible with C {{c|struct}} }}
+
{{dsc named req|cpp/named req/TrivialType|objects of these types can be trivially constructed and copied|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/StandardLayoutType|these types are useful for communicating with code written in other programming languages|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/ImplicitLifetimeType|objects of these types can be implicitly created, and their lifetimes can be implicitly started}}
  
{{dsc h1 | Library-wide}}
+
{{dsc h1|Library-wide}}
{{dsc concept | cpp/concept/EqualityComparable | has a working {{tt|operator{{==}}}} that is an equivalence relation}}
+
{{dsc named req|cpp/named req/BooleanTestable<!-- LWG2114, P2167R3 -->|boolean operations ({{c/core|operator&&}}, {{c/core|operator{{!!}}}}, and {{c/core|operator!}}) have usual semantics}}
{{dsc concept | cpp/concept/LessThanComparable | {{tt|operator<}} is a strict weak ordering relation}}
+
{{dsc named req|cpp/named req/EqualityComparable|{{tt|operator{{==}}}} is an equivalence relation}}
{{dsc concept | cpp/concept/Swappable| can be swapped with an unqualified non-member function call {{c|swap()}} | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/LessThanComparable|{{tt|operator<}} is a strict weak ordering relation}}
{{dsc concept | cpp/concept/ValueSwappable| an {{concept|Iterator}} that dereferences to a {{concept|Swappable}} type | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/Swappable|can be swapped with an unqualified non-member function call {{c|swap()}}}}
{{dsc concept | cpp/concept/NullablePointer| pointer-like type supporting a null value | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/ValueSwappable|a {{named req|Iterator}} that dereferences to a {{named req|Swappable}} type|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/Hash | a {{concept|FunctionObject}} that for inputs with different values has a low probability of giving the same output | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/NullablePointer|a pointer-like type supporting a null value|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/Allocator| class type that contains allocation information}}
+
{{dsc named req|cpp/named req/Hash|a {{named req|FunctionObject}} that for inputs with different values has a low probability of giving the same output|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/FunctionObject | an object that can be called with the function call syntax}}
+
{{dsc named req|cpp/named req/Allocator|a class type that contains allocation information}}
{{dsc concept | cpp/concept/Callable | a type for which the invoke operation is defined}}
+
{{dsc named req|cpp/named req/FunctionObject|an object that can be called with the function call syntax}}
{{dsc concept | cpp/concept/Predicate | a {{concept|FunctionObject}} that returns a value convertible to {{c|bool}} for one argument without modifying it}}
+
{{dsc named req|cpp/named req/Callable|a type for which the invoke operation is defined}}
{{dsc concept | cpp/concept/BinaryPredicate | a {{concept|FunctionObject}} that returns a value convertible to {{c|bool}} for two arguments without modifying them}}
+
{{dsc named req|cpp/named req/Predicate|a {{named req|FunctionObject}} that returns a value convertible to {{c|bool}} for one argument without modifying it}}
{{dsc concept | cpp/concept/Compare | a {{concept|BinaryPredicate}} that establishes an ordering relation}}
+
{{dsc named req|cpp/named req/BinaryPredicate|a {{named req|FunctionObject}} that returns a value convertible to {{c|bool}} for two arguments without modifying them}}
 +
{{dsc named req|cpp/named req/Compare|a {{named req|BinaryPredicate}} that establishes an ordering relation}}
 
{{dsc end}}
 
{{dsc end}}
 +
 
{{dsc begin}}
 
{{dsc begin}}
{{dsc h1 | Container}}
+
{{dsc h1|Container}}
{{dsc concept | cpp/concept/Container | data structure that allows element access using iterators }}
+
{{dsc named req|cpp/named req/Container|data structure that allows element access using iterators}}
{{dsc concept | cpp/concept/ReversibleContainer | container using bidirectional iterators }}
+
{{dsc named req|cpp/named req/ReversibleContainer|container using bidirectional iterators}}
{{dsc concept | cpp/concept/AllocatorAwareContainer | container using an allocator | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/AllocatorAwareContainer|container using an allocator|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/SequenceContainer | container with elements stored linearly }}
+
{{dsc named req|cpp/named req/SequenceContainer|container with elements stored linearly}}
{{dsc concept | cpp/concept/AssociativeContainer | container that stores elements by associating them to keys }}
+
{{dsc named req|cpp/named req/ContiguousContainer|container with elements stored at adjacent memory addresses|notes={{mark c++17}}}}
{{dsc concept | cpp/concept/UnorderedAssociativeContainer | container that stores elements stored in buckets by associating them to keys | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/AssociativeContainer|container that stores elements by associating them to keys}}
{{dsc h2 | Container element}}
+
{{dsc named req|cpp/named req/UnorderedAssociativeContainer|container that stores elements stored in buckets by associating them to keys|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/DefaultInsertable| element can be default-constructed in uninitialized storage | notes={{mark c++11}} }}
+
{{dsc h2|Container element}}
{{dsc concept | cpp/concept/CopyInsertable| element can be copy-constructed in uninitialized storage | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/DefaultInsertable|element can be default-constructed in uninitialized storage|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/MoveInsertable| element can be move-constructed in uninitialized storage | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/CopyInsertable|element can be copy-constructed in uninitialized storage|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/EmplaceConstructible| element can be constructed in uninitialized storage | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/MoveInsertable|element can be move-constructed in uninitialized storage|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/Erasable| element can be destroyed using an allocator | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/EmplaceConstructible|element can be constructed in uninitialized storage|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/Erasable|element can be destroyed using an allocator|notes={{mark c++11}}}}
  
{{dsc h1 | Iterator}}
+
{{dsc h1|Iterator}}
{{dsc concept | cpp/concept/Iterator | general concept to access data within some data structure }}
+
{{dsc named req|cpp/named req/Iterator|title=LegacyIterator|general concept to access data within some data structure}}
{{dsc concept | cpp/concept/InputIterator | iterator that can be used to read data }}
+
{{dsc named req|cpp/named req/InputIterator|title=LegacyInputIterator|iterator that can be used to read data}}
{{dsc concept | cpp/concept/OutputIterator | iterator that can be used to write data }}
+
{{dsc named req|cpp/named req/OutputIterator|title=LegacyOutputIterator|iterator that can be used to write data}}
{{dsc concept | cpp/concept/ForwardIterator | iterator that can be used to read data multiple times}}
+
{{dsc named req|cpp/named req/ForwardIterator|title=LegacyForwardIterator|iterator that can be used to read data multiple times}}
{{dsc concept | cpp/concept/BidirectionalIterator | iterator that can be both incremented and decremented }}
+
{{dsc named req|cpp/named req/BidirectionalIterator|title=LegacyBidirectionalIterator|iterator that can be both incremented and decremented}}
{{dsc concept | cpp/concept/RandomAccessIterator | iterator that can be advanced in constant time }}
+
{{dsc named req|cpp/named req/RandomAccessIterator|title=LegacyRandomAccessIterator|iterator that can be advanced in constant time}}
{{dsc concept | cpp/concept/ContiguousIterator | iterator to contiguously-allocated elements |notes={{mark c++17}} }}
+
{{dsc named req|cpp/named req/ContiguousIterator|title=LegacyContiguousIterator|iterator to contiguously-allocated elements|notes={{mark c++17}}}}
{{dsc h1 | Stream I/O functions }}
+
{{dsc named req|cpp/named req/ConstexprIterator|iterator that can be used during constant expression evaluation|notes={{mark c++20}}}}
<!-- 27.7.2.3[istream.unformatted]/1 -->
+
{{dsc concept | cpp/concept/UnformattedInputFunction | a stream input function that doesn't skip whitespace and counts the processed characters}}
+
<!-- 27.7.2.2.1[istream.formatted.reqmts] -->
+
{{dsc concept | cpp/concept/FormattedInputFunction  | a stream input function that skips leading whitespace}}
+
<!-- 27.7.3.7[ostream.unformatted]/1 -->
+
{{dsc concept | cpp/concept/UnformattedOutputFunction | a basic stream output function }}
+
<!-- 27.7.3.6.1[ostream.formatted.reqmts] -->
+
{{dsc concept | cpp/concept/FormattedOutputFunction | a stream output function that sets failbit on errors and returns a reference to the stream}}
+
  
{{dsc h1 | Random Number Generation}}
+
{{dsc h1|Stream I/O functions}}
{{dsc concept | cpp/concept/SeedSequence | consumes a sequence of integers and produces a sequence of 32-bit unsigned values | notes={{mark c++11}} }}
+
<!--27.7.2.3[istream.unformatted]/1-->
{{dsc concept | cpp/concept/UniformRandomNumberGenerator | returns uniformly distributed random unsigned integers | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/UnformattedInputFunction|a stream input function that does not skip leading whitespace and counts the processed characters}}
{{dsc concept | cpp/concept/RandomNumberEngine | a deterministic {{concept|UniformRandomNumberGenerator}}, defined by the seed | notes={{mark c++11}} }}
+
<!--27.7.2.2.1[istream.formatted.reqmts]-->
{{dsc concept | cpp/concept/RandomNumberEngineAdaptor | a {{concept|RandomNumberEngine}} that transforms the output of another {{concept|RandomNumberEngine}} | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/FormattedInputFunction|a stream input function that skips leading whitespace}}
{{dsc concept | cpp/concept/RandomNumberDistribution | returns random numbers distributed according to a given mathematical probability density function | notes={{mark c++11}} }}
+
<!--27.7.3.7[ostream.unformatted]/1-->
 +
{{dsc named req|cpp/named req/UnformattedOutputFunction|a basic stream output function}}
 +
<!--27.7.3.6.1[ostream.formatted.reqmts]-->
 +
{{dsc named req|cpp/named req/FormattedOutputFunction|a stream output function that sets failbit on errors and returns a reference to the stream}}
  
{{dsc h1 | Concurrency}}
+
{{dsc h1|Formatters}}
{{dsc concept | cpp/concept/BasicLockable | provides exclusive ownership semantics for execution agents (i.e. threads) | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/BasicFormatter|abstracts formatting operations for a given formatting argument type and character type|notes={{mark c++20}}}}
{{dsc concept | cpp/concept/Lockable | adds attempted lock acquisition to {{concept|BasicLockable}} | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/Formatter|defines functions used by the [[cpp/utility/format|formatting library]]|notes={{mark c++20}}}}
{{dsc concept | cpp/concept/TimedLockable | adds timed lock acquisition to {{concept|Lockable}} | notes={{mark c++11}} }}
+
{{dsc concept | cpp/concept/Mutex | a {{concept|Lockable}} that protects against data races and sequentially consistent synchronization | notes={{mark c++11}} }}
+
{{dsc concept | cpp/concept/TimedMutex | a {{concept|TimedLockable}} that protects against data races and sequentially consistent synchronization | notes={{mark c++11}} }}
+
{{dsc concept | cpp/concept/SharedTimedMutex | a {{concept|TimedMutex}} that supports shared ownership mode | notes={{mark c++14}} }}
+
  
{{dsc h1 | Other}}
+
{{dsc h1|Random Number Generation}}
{{dsc concept | cpp/concept/UnaryTypeTrait | describes a property of a type | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/SeedSequence|consumes a sequence of integers and produces a sequence of 32-bit unsigned values|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/BinaryTypeTrait | describes a relationship  between two types | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/UniformRandomBitGenerator|returns uniformly distributed random unsigned integers|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/TransformationTrait | modifies a property of a type | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/RandomNumberEngine|a deterministic {{named req|UniformRandomBitGenerator}}, defined by the seed|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/Clock | aggregates a duration, a time point, and a function to get the current time point | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/RandomNumberEngineAdaptor|a {{named req|RandomNumberEngine}} that transforms the output of another {{named req|RandomNumberEngine}}|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/TrivialClock | a {{concept|Clock}} that doesn't throw exceptions | notes={{mark c++11}} }}
+
{{dsc named req|cpp/named req/RandomNumberDistribution|returns random numbers distributed according to a given mathematical probability density function|notes={{mark c++11}}}}
{{dsc concept | cpp/concept/CharTraits | defines types and functions for a character type}}
+
{{dsc concept | cpp/concept/pos_type | represents a position in a stream }}
+
{{dsc concept | cpp/concept/off_type | represents an offset in a stream }}
+
{{dsc concept | cpp/concept/BitmaskType | bitset, integer, or enumeration}} <!-- $17.5.2.1.3[bitmask types] -->
+
{{dsc concept | cpp/concept/NumericType | a type for which initialization is effectively equal to assignment }} <!-- C++98/03 §26.1[lib.numeric.requirements], C++11/14 §26.2[numeric.requirements] -->
+
{{dsc concept | cpp/concept/RegexTraits | defines types and functions used by the [[cpp/regex|regular expressions library]] | notes={{mark c++11}}}} <!-- C++11/14 §28.3[re.req] -->
+
{{dsc concept | cpp/concept/LiteralType | a type with constexpr constructor | notes={{mark c++11}} }}
+
  
{{dsc end}}
+
{{dsc h1|Concurrency}}
 +
{{dsc named req|cpp/named req/BasicLockable|provides exclusive ownership semantics for execution agents (i.e. threads)|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/Lockable|a {{named req|BasicLockable}} that supports attempted lock acquisition|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/TimedLockable|a {{named req|Lockable}} that supports timed lock acquisition|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/SharedLockable|provides shared ownership semantics for execution agents (i.e. threads)|notes={{mark c++14}}<!--P2160R1-->}}
 +
{{dsc named req|cpp/named req/SharedTimedLockable|a {{named req|SharedLockable}} that supports timed lock acquisition|notes={{mark c++14}}<!--P2160R1-->}}
 +
{{dsc named req|cpp/named req/Mutex|a {{named req|Lockable}} that protects against data races and sequentially consistent synchronization|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/TimedMutex|a {{named req|TimedLockable}} that protects against data races and sequentially consistent synchronization|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/SharedMutex|a {{named req|Mutex}} that supports shared ownership semantics|notes={{mark c++17}}}}
 +
{{dsc named req|cpp/named req/SharedTimedMutex|a {{named req|TimedMutex}} that supports shared ownership semantics|notes={{mark c++14}}}}
  
 +
{{dsc h1|Ranges}}
 +
{{dsc named req|cpp/named req/RangeAdaptorObject|a {{named req|FunctionObject}} that creates a [[cpp/ranges#Range adaptors|range adaptor]] from a {{lconcept|viewable_range}} and additional arguments|notes={{mark c++20}}}}
 +
{{dsc named req|cpp/named req/RangeAdaptorClosureObject|a {{named req|FunctionObject}} that supports the pipe operator|notes={{mark c++20}}}}
 +
 +
{{dsc h1|Multidimensional View Customization}}
 +
{{dsc named req|cpp/named req/LayoutMapping|controls the mapping of multidimensional index in {{lc|mdspan}}|notes={{mark c++23}}}}
 +
{{dsc named req|cpp/named req/LayoutMappingPolicy|a policy that holds {{named req|LayoutMapping}} requirements|notes={{mark c++23}}}}
 +
{{dsc named req|cpp/named req/AccessorPolicy|a policy that controls access to data handle in {{lc|mdspan}}|notes={{mark c++23}}}}
 +
 +
{{dsc h1|Other}}
 +
{{dsc named req|cpp/named req/UnaryTypeTrait|describes a property of a type|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/BinaryTypeTrait|describes a relationship between two types|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/TransformationTrait|modifies a property of a type|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/Clock|aggregates a duration, a time point, and a function to get the current time point|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/TrivialClock|a {{named req|Clock}} that does not throw exceptions|notes={{mark c++11}}}}
 +
{{dsc named req|cpp/named req/CharTraits|defines types and functions for a character type}}
 +
{{dsc named req|cpp/named req/BitmaskType|bitset, integer, or enumeration}}<!--$17.5.2.1.3[bitmask types]-->
 +
{{dsc named req|cpp/named req/NumericType|a type for which initialization is effectively equal to assignment}}<!--C++98/03 §26.1[lib.numeric.requirements], C++11/14 §26.2[numeric.requirements]-->
 +
{{dsc named req|cpp/named req/RegexTraits|defines types and functions used by the [[cpp/regex|regular expressions library]]|notes={{mark c++11}}}}<!--C++11/14 §28.3[re.req]-->
 +
{{dsc named req|cpp/named req/LiteralType|a type with constexpr constructor|notes={{mark c++11}}}}
 +
{{dsc end}}
  
{{todo|Any other missing concept?}}
+
{{todo|Any other missing requirement?}}
  
[[ar:cpp/concept]]
+
{{langlinks|ar|de|es|fr|it|ja|pt|ru|zh}}
[[de:cpp/concept]]
+
[[es:cpp/concept]]
+
[[fr:cpp/concept]]
+
[[it:cpp/concept]]
+
[[ja:cpp/concept]]
+
[[pt:cpp/concept]]
+
[[ru:cpp/concept]]
+
[[zh:cpp/concept]]
+

Latest revision as of 22:51, 7 September 2024

 
 
C++ 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.

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.

Contents

Basic

specifies that an object of the type can be default constructed
(named requirement)
specifies that an object of the type can be constructed from rvalue
(named requirement)
specifies that an object of the type can be constructed from lvalue
(named requirement)
specifies that an object of the type can be assigned from rvalue
(named requirement)
specifies that an object of the type can be assigned from lvalue
(named requirement)
specifies that an object of the type can be destroyed
(named requirement)

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.
object types that are not array types or class types
(named requirement)
(deprecated in C++20)
POD (Plain Old Data) types, compatible with C struct
(named requirement)
objects of these types can maintain their values after copying their underlying bytes
(named requirement)
objects of these types can be trivially constructed and copied
(named requirement)
these types are useful for communicating with code written in other programming languages
(named requirement)
objects of these types can be implicitly created, and their lifetimes can be implicitly started
(named requirement)

Library-wide

boolean operations (operator&&, operator||, and operator!) have usual semantics
(named requirement)
operator== is an equivalence relation
(named requirement)
operator< is a strict weak ordering relation
(named requirement)
can be swapped with an unqualified non-member function call swap()
(named requirement)
a LegacyIterator that dereferences to a Swappable type
(named requirement)
a pointer-like type supporting a null value
(named requirement)
(C++11)
a FunctionObject that for inputs with different values has a low probability of giving the same output
(named requirement)
a class type that contains allocation information
(named requirement)
an object that can be called with the function call syntax
(named requirement)
a type for which the invoke operation is defined
(named requirement)
a FunctionObject that returns a value convertible to bool for one argument without modifying it
(named requirement)
a FunctionObject that returns a value convertible to bool for two arguments without modifying them
(named requirement)
a BinaryPredicate that establishes an ordering relation
(named requirement)

Container

data structure that allows element access using iterators
(named requirement)
container using bidirectional iterators
(named requirement)
container using an allocator
(named requirement)
container with elements stored linearly
(named requirement)
container with elements stored at adjacent memory addresses
(named requirement)
container that stores elements by associating them to keys
(named requirement)
container that stores elements stored in buckets by associating them to keys
(named requirement)
Container element
element can be default-constructed in uninitialized storage
(named requirement)
element can be copy-constructed in uninitialized storage
(named requirement)
element can be move-constructed in uninitialized storage
(named requirement)
element can be constructed in uninitialized storage
(named requirement)
(C++11)
element can be destroyed using an allocator
(named requirement)

Iterator

general concept to access data within some data structure
(named requirement)
iterator that can be used to read data
(named requirement)
iterator that can be used to write data
(named requirement)
iterator that can be used to read data multiple times
(named requirement)
iterator that can be both incremented and decremented
(named requirement)
iterator that can be advanced in constant time
(named requirement)
iterator to contiguously-allocated elements
(named requirement)
iterator that can be used during constant expression evaluation
(named requirement)

Stream I/O functions

a stream input function that does not skip leading whitespace and counts the processed characters
(named requirement)
a stream input function that skips leading whitespace
(named requirement)
a basic stream output function
(named requirement)
a stream output function that sets failbit on errors and returns a reference to the stream
(named requirement)

Formatters

abstracts formatting operations for a given formatting argument type and character type
(named requirement)
(C++20)
defines functions used by the formatting library
(named requirement)

Random Number Generation

consumes a sequence of integers and produces a sequence of 32-bit unsigned values
(named requirement)
returns uniformly distributed random unsigned integers
(named requirement)
a deterministic UniformRandomBitGenerator, defined by the seed
(named requirement)
a RandomNumberEngine that transforms the output of another RandomNumberEngine
(named requirement)
returns random numbers distributed according to a given mathematical probability density function
(named requirement)

Concurrency

provides exclusive ownership semantics for execution agents (i.e. threads)
(named requirement)
(C++11)
a BasicLockable that supports attempted lock acquisition
(named requirement)
a Lockable that supports timed lock acquisition
(named requirement)
provides shared ownership semantics for execution agents (i.e. threads)
(named requirement)
a SharedLockable that supports timed lock acquisition
(named requirement)
(C++11)
a Lockable that protects against data races and sequentially consistent synchronization
(named requirement)
(C++11)
a TimedLockable that protects against data races and sequentially consistent synchronization
(named requirement)
a Mutex that supports shared ownership semantics
(named requirement)
a TimedMutex that supports shared ownership semantics
(named requirement)

Ranges

a FunctionObject that creates a range adaptor from a viewable_range and additional arguments
(named requirement)
a FunctionObject that supports the pipe operator
(named requirement)

Multidimensional View Customization

controls the mapping of multidimensional index in mdspan
(named requirement)
a policy that holds LayoutMapping requirements
(named requirement)
a policy that controls access to data handle in mdspan
(named requirement)

Other

describes a property of a type
(named requirement)
describes a relationship between two types
(named requirement)
modifies a property of a type
(named requirement)
(C++11)
aggregates a duration, a time point, and a function to get the current time point
(named requirement)
a Clock that does not throw exceptions
(named requirement)
defines types and functions for a character type
(named requirement)
bitset, integer, or enumeration
(named requirement)
a type for which initialization is effectively equal to assignment
(named requirement)
defines types and functions used by the regular expressions library
(named requirement)
a type with constexpr constructor
(named requirement)