Concepts
From cppreference.com
< cpp
C++ Reference | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C++ concepts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Concept is a term that describes a set of characteristics of a type. Concepts are a more convenient way to specify both what properties are expected from a type, and what properties a type has.
There was a proposal to include formal specification of concepts into the C++ language, so that the compiler could check the type requirements before template instantiation and in turn could produce much more sensible error messages in case a type did not fulfill the template requirements. This proposal was later dropped for various reasons. However, there are unofficial plans to add concepts to a future revision of the C++ language.
Basic | ||
specifies that type has default constructor (concept) | ||
(C++11) | specifies that type has move constructor (concept) | |
specifies that type has copy constructor (concept) | ||
(C++11) | specifies that type can move assignment operator (concept) | |
specifies that type has copy assignment operator (concept) | ||
type has a destructor that clears all memory (concept) | ||
Library-wide | ||
has a working operator== that is an equivalence relation (concept) | ||
operator< is a strict weak ordering relation (concept) | ||
(C++11) | can be used as argument of std::swap (concept) | |
(C++11) | Pointer-like type that when dereferenced can be passed to std::swap (concept) | |
(C++11) | Pointer-like type supporting a null value (concept) | |
(C++11) | (concept) | |
Class type that contains allocation information (concept) | ||
Container | ||
data structure that allows element access using iterators (concept) | ||
container using bidirectional iterators (concept) | ||
(C++11) | container using an allocator (concept) | |
container with elements stored linearly (concept) | ||
container that stores elements by associating them to keys (concept) | ||
container that stores elements stored in buckets by associating them to keys (concept) | ||
Container element | ||
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
Iterator | ||
general concept to access data within some data structure (concept) | ||
iterator that can be used to read data (concept) | ||
iterator that can be used to write data (concept) | ||
iterator that can be used to read data multiple times (concept) | ||
iterator that can be both incremented and decremented (concept) | ||
iterator that can be advanced in constant time (concept) | ||
Random Number Generation | ||
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
Concurrency | ||
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
Other | ||
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(C++11) | (concept) | |
(concept) | ||
(concept) | ||
(concept) |
This section is incomplete Reason: Any other missing concept? |