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

3.8 KiB

[support.contract.enum]

17 Language support library [support]

17.10 Contract-violation handling [support.contract]

17.10.2 Enumerations [support.contract.enum]

1

#

Recommended practice: For all enumerations in [support.contract.enum], if implementation-defined enumerators are provided, they should have a minimum value of 1000.

2

#

The enumerators of assertion_kind correspond to the syntactic forms of a contract assertion ([basic.contract.general]), with meanings listed in Table 44.

Table 44 — Enum assertion_kind [tab:support.contract.enum.kind]

🔗
Name
Meaning
🔗
pre
A precondition assertion
🔗
post
A postcondition assertion
🔗
assert
An assertion-statement
🔗

3

#

The enumerators of evaluation_semantic correspond to the evaluation semantics with which a contract assertion may be evaluated ([basic.contract.eval]), with meanings listed in Table 45.

Table 45 — Enum evaluation_semantic [tab:support.contract.enum.semantic]

🔗
Name
Meaning
🔗
ignore
Ignore evaluation semantic
🔗
observe
Observe evaluation semantic
🔗
enforce
Enforce evaluation semantic
🔗
quick_enforce
Quick-enforce evaluation semantic
🔗

4

#

The enumerators of detection_mode correspond to the manners in which a contract violation can be identified ([basic.contract.eval]), with meanings listed in Table 46.

Table 46 — Enum detection_mode [tab:support.contract.enum.detection]

🔗
Name
Meaning
🔗
predicate_false
The predicate of the contract assertion evaluated to false or would have evaluated to false.
🔗
evaluation_exception
An uncaught exception occurred during evaluation of the contract assertion.
🔗