Skip to content

Commit ad8ce13

Browse files
authored
add missing backquote and update to new snake_case names (#1022)
Signed-off-by: gregmarr <[email protected]>
1 parent 6c84a17 commit ad8ce13

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/cpp2/contracts.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Notes:
1515

1616
- Optionally, `condition` may be followed by `, "message"`, a message to include if a violation occurs. For example, `pre(condition, "message")`.
1717

18-
- Optionally, a `<group, pred1, pred2>` can be written inside `<` `>` angle brackets immediately before the `(`, to designate that this test is part of the [contract group](#groups) named `group` and (also optionally) [contract predicates](#predicates) `pred1` and `pred2. If a violation occurs, `Group.report_violation()` will be called. For example, `pre<group>(condition)`.
18+
- Optionally, a `<group, pred1, pred2>` can be written inside `<` `>` angle brackets immediately before the `(`, to designate that this test is part of the [contract group](#groups) named `group` and (also optionally) [contract predicates](#predicates) `pred1` and `pred2`. If a violation occurs, `Group.report_violation()` will be called. For example, `pre<group>(condition)`.
1919

2020
The order of evaluation is:
2121

@@ -31,7 +31,7 @@ For example:
3131

3232
``` cpp title="Precondition and postcondition examples" hl_lines="2 3"
3333
insert_at: (container, where: int, val: int)
34-
pre<Bounds>( 0 <= where <= container.ssize(), "position (where)$ is outside 'container'" )
34+
pre<bounds_safety>( 0 <= where <= container.ssize(), "position (where)$ is outside 'container'" )
3535
post ( container.ssize() == container.ssize()$ + 1 )
3636
= {
3737
_ = container.insert( container.begin()+where, val );
@@ -42,9 +42,9 @@ In this example:
4242
4343
- The `$` captures are performed before entering the function.
4444
45-
- The precondition is part of the `Bounds` safety contract group and is checked before entering the function. If the check fails, say because `where` is `#!cpp -1`, then `#!cpp cpp2::Bounds.report_violation("position -1 is outside 'container'")` is called.
45+
- The precondition is part of the `bounds_safety` contract group and is checked before entering the function. If the check fails, say because `where` is `#!cpp -1`, then `#!cpp cpp2::bounds_safety.report_violation("position -1 is outside 'container'")` is called.
4646
47-
- The postcondition is part of the `Default` safety contract group. If the check fails, then `#!cpp cpp2::Default.report_violation()` is called.
47+
- The postcondition is part of the `default` safety contract group. If the check fails, then `#!cpp cpp2::default.report_violation()` is called.
4848
4949
5050
## <a id="groups"></a> Contract groups

0 commit comments

Comments
 (0)