Namespaces
Variants
Views
Actions

Concepts

From cppreference.com
< cpp
Revision as of 05:02, 11 March 2012 by P12 (Talk | contribs)

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)