Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/named req"

From cppreference.com
< cpp
(I've added these as a seealso to individual pages.)
(+initial list of other concepts)
Line 13: Line 13:
 
{{dcl list concept | cpp/concept/CopyAssignable | specifies that type has copy assignment operator}}
 
{{dcl list concept | cpp/concept/CopyAssignable | specifies that type has copy assignment operator}}
 
{{dcl list concept | cpp/concept/MoveAssignable | specifies that type can move assignment operator | notes={{mark c++11}}}}
 
{{dcl list concept | cpp/concept/MoveAssignable | specifies that type can move assignment operator | notes={{mark c++11}}}}
 +
 
{{dcl list end}}
 
{{dcl list end}}
  
 
{{todo|Add other requirement classes such as ForwardIterator, etc.}}.
 
{{todo|Add other requirement classes such as ForwardIterator, etc.}}.
 +
 +
{{dcl list begin}}
 +
{{dcl list concept | cpp/concept/Swappable |}}
 +
{{dcl list concept | cpp/concept/Destructible | }}
 +
{{dcl list concept | cpp/concept/NullablePointer}}
 +
{{dcl list concept | cpp/concept/Hash}}
 +
{{dcl list concept | cpp/concept/Allocator}}
 +
{{dcl list concept | cpp/concept/UnaryTypeTrait}}
 +
{{dcl list concept | cpp/concept/BinaryTypeTrait}}
 +
{{dcl list concept | cpp/concept/Destructible}}
 +
{{dcl list concept | cpp/concept/TransformationTrait}}
 +
{{dcl list concept | cpp/concept/Clock}}
 +
{{dcl list concept | cpp/concept/TrivialClock}}
 +
{{dcl list concept | cpp/concept/LessThanComparable}}
 +
{{dcl list concept | cpp/concept/EqualityComparable}}
 +
{{dcl list concept | cpp/concept/CharTraits}}
 +
{{dcl list concept | cpp/concept/pos_type}}
 +
{{dcl list concept | cpp/concept/off_type}}
 +
{{dcl list concept | cpp/concept/Container}}
 +
{{dcl list concept | cpp/concept/ReversibleContainer}}
 +
{{dcl list concept | cpp/concept/AllocatorAwareContainer}}
 +
{{dcl list concept | cpp/concept/CopyInsertable}}
 +
{{dcl list concept | cpp/concept/MoveInsertable}}
 +
{{dcl list concept | cpp/concept/EmplaceConstructible}}
 +
{{dcl list concept | cpp/concept/AssociativeContainer}}
 +
{{dcl list concept | cpp/concept/SequenceContainer}}
 +
{{dcl list concept | cpp/concept/UnorderedAssociativeContainer}}
 +
{{dcl list concept | cpp/concept/Iterator}}
 +
{{dcl list concept | cpp/concept/InputIterator}}
 +
{{dcl list concept | cpp/concept/OutputIterator}}
 +
{{dcl list concept | cpp/concept/ForwardIterator}}
 +
{{dcl list concept | cpp/concept/BidirectionalIterator}}
 +
{{dcl list concept | cpp/concept/RandomAccessIterator}}
 +
{{dcl list concept | cpp/concept/ValueSwappable}}
 +
{{dcl list concept | cpp/concept/SeedSequence}}
 +
{{dcl list concept | cpp/concept/UniformRandomNumberGenerator}}
 +
{{dcl list concept | cpp/concept/RandomNumberEngine}}
 +
{{dcl list concept | cpp/concept/RandomNumberEngineAdaptor}}
 +
{{dcl list concept | cpp/concept/RandomNumberDistribution}}
 +
{{dcl list concept | cpp/concept/BasicLockable}}
 +
{{dcl list concept | cpp/concept/Lockable}}
 +
{{dcl list concept | cpp/concept/TimedLockable}}
 +
{{dcl list concept | cpp/concept/Mutex}}
 +
{{dcl list concept | cpp/concept/TimedMutex}}
 +
{{dcl list end}}

Revision as of 13:57, 11 March 2012

Template:cpp/concept/sidebar

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 concepts

specifies that type has default constructor
(concept)
specifies that type has copy constructor
(concept)
specifies that type has move constructor
(concept)
specifies that type has copy assignment operator
(concept)
specifies that type can move assignment operator
(concept)
.

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)

(concept)