From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/gcc~13/c_002b_002b-concepts.html | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 devdocs/gcc~13/c_002b_002b-concepts.html (limited to 'devdocs/gcc~13/c_002b_002b-concepts.html') diff --git a/devdocs/gcc~13/c_002b_002b-concepts.html b/devdocs/gcc~13/c_002b_002b-concepts.html new file mode 100644 index 00000000..f8fbb16e --- /dev/null +++ b/devdocs/gcc~13/c_002b_002b-concepts.html @@ -0,0 +1,23 @@ +

7.10 C++ Concepts

C++ concepts provide much-improved support for generic programming. In particular, they allow the specification of constraints on template arguments. The constraints are used to extend the usual overloading and partial specialization capabilities of the language, allowing generic data structures and algorithms to be “refined” based on their properties rather than their type names.

The following keywords are reserved for concepts.

+assumes +
+

States an expression as an assumption, and if possible, verifies that the assumption is valid. For example, assume(n > 0).

+axiom +
+

Introduces an axiom definition. Axioms introduce requirements on values.

+forall +
+

Introduces a universally quantified object in an axiom. For example, forall (int n) n + 0 == n).

+concept +
+

Introduces a concept definition. Concepts are sets of syntactic and semantic requirements on types and their values.

+requires +

Introduces constraints on template arguments or requirements for a member function of a class template.

The front end also exposes a number of internal mechanism that can be used to simplify the writing of type traits. Note that some of these traits are likely to be removed in the future.

+Built-in Function: bool __is_same (type1, type2) +

A binary type trait: true whenever the type1 and type2 refer to the same type.

+
+

+ © Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
+ https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/C_002b_002b-Concepts.html +

+
-- cgit v1.2.3