tmp/tmpa0pbqsbs/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Header `<contracts>` synopsis <a id="contracts.syn">[[contracts.syn]]</a>
|
| 2 |
+
|
| 3 |
+
The header `<contracts>` defines types for reporting information about
|
| 4 |
+
contract violations [[basic.contract.eval]].
|
| 5 |
+
|
| 6 |
+
``` cpp
|
| 7 |
+
// all freestanding
|
| 8 |
+
namespace std::contracts {
|
| 9 |
+
|
| 10 |
+
enum class assertion_kind : unspecified {
|
| 11 |
+
pre = 1,
|
| 12 |
+
post = 2,
|
| 13 |
+
assert = 3
|
| 14 |
+
};
|
| 15 |
+
|
| 16 |
+
enum class evaluation_semantic : unspecified {
|
| 17 |
+
ignore = 1,
|
| 18 |
+
observe = 2,
|
| 19 |
+
enforce = 3,
|
| 20 |
+
quick_enforce = 4
|
| 21 |
+
};
|
| 22 |
+
|
| 23 |
+
enum class detection_mode : unspecified {
|
| 24 |
+
predicate_false = 1,
|
| 25 |
+
evaluation_exception = 2
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
class contract_violation {
|
| 29 |
+
// no user-accessible constructor
|
| 30 |
+
public:
|
| 31 |
+
contract_violation(const contract_violation&) = delete;
|
| 32 |
+
contract_violation& operator=(const contract_violation&) = delete;
|
| 33 |
+
|
| 34 |
+
see below ~contract_violation();
|
| 35 |
+
|
| 36 |
+
const char* comment() const noexcept;
|
| 37 |
+
contracts::detection_mode detection_mode() const noexcept;
|
| 38 |
+
exception_ptr evaluation_exception() const noexcept;
|
| 39 |
+
bool is_terminating() const noexcept;
|
| 40 |
+
assertion_kind kind() const noexcept;
|
| 41 |
+
source_location location() const noexcept;
|
| 42 |
+
evaluation_semantic semantic() const noexcept;
|
| 43 |
+
};
|
| 44 |
+
|
| 45 |
+
void invoke_default_contract_violation_handler(const contract_violation&);
|
| 46 |
+
}
|
| 47 |
+
```
|
| 48 |
+
|