Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README improvements #32

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ strings, or be left undefined, in which case it defaults to `verbose`.
use, but can be useful for measuring the overall performance impact
of checking in a program.

- `ADOBE_CONTRACT_VIOLATION=custom_verbose`: When a contract violation is detected, a custom handler
- `ADOBE_CONTRACT_VIOLATION=custom_verbose`: When a contract violation is detected, a custom
verbose handler
is invoked. The client must define the handler in the `adobe` namespace with the signature:

```cpp
Expand All @@ -253,7 +254,7 @@ strings, or be left undefined, in which case it defaults to `verbose`.
application, and must not return to its caller.

- `ADOBE_CONTRACT_VIOLATION=custom_lightweight`: When a contract violation is detected, a custom
handler is invoked. The client must define the handler in the `adobe` namespace with the signature:
lightweight handler is invoked. The client must define the handler in the `adobe` namespace with the signature:

```cpp
[[noreturn]] void ::adobe::contract_violated_lightweight() {
Expand All @@ -263,7 +264,6 @@ strings, or be left undefined, in which case it defaults to `verbose`.

The function should report the violation in a way that is appropriate for the application, and
must not return to its caller.
function must not return.

In `verbose` and `lightweight` modes, a failed check ultimately calls
[`std::terminate()`](https://en.cppreference.com/w/cpp/error/terminate)
Expand Down Expand Up @@ -437,6 +437,13 @@ target_link_libraries(my-executable PRIVATE adobe-contract-checks)
#endif
```

- Include a document in your project describing standard
preconditions that don't need to be specified explicitly, and that hold
unless explicitly contradicted by documentation. They should
still be checked, but not having to explicitly document that every
`const char*` refers to a null-terminated byte string, for example, can
be a big win.

## Rationales

### Why This Library Provides No Postcondition Check
Expand Down