gcc: C++ Concepts
1
1 7.10 C++ Concepts
1 =================
1
1 C++ concepts provide much-improved support for generic programming. In
1 particular, they allow the specification of constraints on template
1 arguments. The constraints are used to extend the usual overloading and
1 partial specialization capabilities of the language, allowing generic
1 data structures and algorithms to be "refined" based on their properties
1 rather than their type names.
1
1 The following keywords are reserved for concepts.
1
1 'assumes'
1 States an expression as an assumption, and if possible, verifies
1 that the assumption is valid. For example, 'assume(n > 0)'.
1
1 'axiom'
1 Introduces an axiom definition. Axioms introduce requirements on
1 values.
1
1 'forall'
1 Introduces a universally quantified object in an axiom. For
1 example, 'forall (int n) n + 0 == n').
1
1 'concept'
1 Introduces a concept definition. Concepts are sets of syntactic
1 and semantic requirements on types and their values.
1
1 'requires'
1 Introduces constraints on template arguments or requirements for a
1 member function of a class template.
1
1 The front end also exposes a number of internal mechanism that can be
1 used to simplify the writing of type traits. Note that some of these
1 traits are likely to be removed in the future.
1
1 '__is_same (type1, type2)'
1 A binary type trait: true whenever the type arguments are the same.
1