| 1 |
The bodies of tt(requires) declarations contain define constraints to apply to |
| 2 |
template parameters. There are four types of requirements: |
| 3 |
itemization( |
| 4 |
it() em(Simple requirements): constraints on em(facilities) (like |
| 5 |
requiring the availability of tt(operator+)); |
| 6 |
it() em(Type requirements): requiring the availability of (sub)types (like |
| 7 |
the sub-type tt(value_type)) which must be available when using |
| 8 |
standard tt(push_back) functions; |
| 9 |
it() em(Compound requirements): requiring types resulting from applying |
| 10 |
operators or returned by called (member) functions; |
| 11 |
it() em(Nested requirements): defining concepts in terms of already |
| 12 |
existing concepts. |
| 13 |
) |
| 14 |
|
| 15 |
Constraints must be compile-time verifiable. |
| 16 |
|
| 17 |
When multiple constraints are specified, they must em(all) be compile-time |
| 18 |
verifiable, and an actual type is only accepted by the compiler if all |
| 19 |
requirements could be satisfied. |
| 20 |
|
| 21 |
COMMENT( |
| 22 |
Multiple constraints |
| 23 |
can be defined by specifying multiple requirements in |
| 24 |
tt(requires)-specifications and/or by |
| 25 |
combining constraints using the boolean operators tt(and, or) and tt(not). |
| 26 |
END) |