Files
cppdraft_translate/cppdraft/support/contract/enum.md
2025-10-25 03:02:53 +03:00

68 lines
3.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[support.contract.enum]
# 17 Language support library [[support]](./#support)
## 17.10 Contract-violation handling [[support.contract]](support.contract#enum)
### 17.10.2 Enumerations [support.contract.enum]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L4438)
*Recommended practice*: For all enumerations in [support.contract.enum],
if implementation-defined enumerators are provided,
they should have a minimum value of 1000[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L4444)
The enumerators of assertion_kind correspond to
the syntactic forms of a contract assertion ([[basic.contract.general]](basic.contract.general "6.11.1General")),
with meanings listed in Table [44](#tab:support.contract.enum.kind "Table 44: Enum assertion_­kind")[.](#2.sentence-1)
Table [44](#tab:support.contract.enum.kind) — Enum assertion_kind [[tab:support.contract.enum.kind]](./tab:support.contract.enum.kind)
| [🔗](#tab:support.contract.enum.kind-row-1)<br>**Name** | **Meaning** |
| --- | --- |
| [🔗](#tab:support.contract.enum.kind-row-2)<br>pre | A precondition assertion |
| [🔗](#tab:support.contract.enum.kind-row-3)<br>post | A postcondition assertion |
| [🔗](#tab:support.contract.enum.kind-row-4)<br>assert | An [*assertion-statement*](stmt.contract.assert#nt:assertion-statement "8.9Assertion statement[stmt.contract.assert]") |
| [🔗](#tab:support.contract.enum.kind-row-5) |
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L4459)
The enumerators of evaluation_semantic correspond to
the evaluation semantics with which
a contract assertion may be evaluated ([[basic.contract.eval]](basic.contract.eval "6.11.2Evaluation")),
with meanings listed in Table [45](#tab:support.contract.enum.semantic "Table 45: Enum evaluation_­semantic")[.](#3.sentence-1)
Table [45](#tab:support.contract.enum.semantic) — Enum evaluation_semantic [[tab:support.contract.enum.semantic]](./tab:support.contract.enum.semantic)
| [🔗](#tab:support.contract.enum.semantic-row-1)<br>**Name** | **Meaning** |
| --- | --- |
| [🔗](#tab:support.contract.enum.semantic-row-2)<br>ignore | Ignore evaluation semantic |
| [🔗](#tab:support.contract.enum.semantic-row-3)<br>observe | Observe evaluation semantic |
| [🔗](#tab:support.contract.enum.semantic-row-4)<br>enforce | Enforce evaluation semantic |
| [🔗](#tab:support.contract.enum.semantic-row-5)<br>quick_enforce | Quick-enforce evaluation semantic |
| [🔗](#tab:support.contract.enum.semantic-row-6) |
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/support.tex#L4476)
The enumerators of detection_mode correspond to the manners in which a
contract violation can be identified ([[basic.contract.eval]](basic.contract.eval "6.11.2Evaluation")), with
meanings listed in Table [46](#tab:support.contract.enum.detection "Table 46: Enum detection_­mode")[.](#4.sentence-1)
Table [46](#tab:support.contract.enum.detection) — Enum detection_mode [[tab:support.contract.enum.detection]](./tab:support.contract.enum.detection)
| [🔗](#tab:support.contract.enum.detection-row-1)<br>**Name** | **Meaning** |
| --- | --- |
| [🔗](#tab:support.contract.enum.detection-row-2)<br>predicate_false | The predicate of the contract assertion evaluated to false or would have evaluated to false[.](#tab:support.contract.enum.detection-row-2-column-2-sentence-1) |
| [🔗](#tab:support.contract.enum.detection-row-3)<br>evaluation_exception | An uncaught exception occurred during evaluation of the contract assertion[.](#tab:support.contract.enum.detection-row-3-column-2-sentence-1) |
| [🔗](#tab:support.contract.enum.detection-row-4) |