Skip to content

Commit 85f6612

Browse files
authored
Fix damaged markdown in compile-time-programming/requires-expressions.md (#66)
1 parent 9860154 commit 85f6612

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compile-time-programming/requires-expressions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ A student should be able to:
100100
### Points to cover
101101

102102
* Compound-requirements allow the optional ability to test whether an expression is marked as `noexcept`, by using a trailing `noexcept` keyword.
103-
```
103+
104+
```cpp
104105
struct S
105106
{
106107
void foo() noexcept {}
@@ -109,7 +110,8 @@ struct S
109110

110111
static_assert(requires(S s) { { s.foo() } noexcept; } ); // Succeeds. s.foo() is noexcept
111112
static_assert(requires(S s) { { s.bar() } noexcept; } ); // Fails. s.bar() is not noexcept
112-
```
113+
```
114+
113115
* If the return-type-requirement of a compound-requirement is a concept, that concept is given the resulting type as the first parameter, followed by the specified parameters in the compound-requirement. `{ ++x } -> C<int>` would substitute `C<decltype((++x)), int>` and check that concept C is satisfied for those parameters.
114116
115117
## Advanced

0 commit comments

Comments
 (0)