Concept (generic programming)
From Wikipedia, the free encyclopedia
This article may require cleanup to meet Wikipedia's quality standards. Please improve this article if you can. (December 2006) |
In generic programming, a concept is a description of supported operations on a type, including syntax and semantics. In this way, concepts are related to abstract base classes but concepts do not require a subtype relationship. The term was in use as early as 1998.[1]
For example, if a type I
satisfies the Trivial Iterator concept in C++, and i
is of type I
, the following are valid expressions with corresponding semantics:[2]
I i
default construction.*i
must be convertible to some typeT
.i->m
is valid if(*i).m
is.
Concepts have been accepted into the C++ standard for the next revision.
[edit] See also
[edit] References
- ^ Austern, M.H. Generic programming and the STL: using and extending the C++ Standard Template Library. 1998. pp 17–18
- ^ Trivial Iterator