Concept (generic programming)

From Wikipedia, the free encyclopedia

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 type T.
  • 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

  1. ^ Austern, M.H. Generic programming and the STL: using and extending the C++ Standard Template Library. 1998. pp 17–18
  2. ^ Trivial Iterator

[edit] External links