Repository navigation
Commit 482a1c9
authored
code: fix concepts example to valid C++20 syntax (#320)
10.2.concepts.cpp used the Concepts TS syntax that was removed before
C++20 was finalized, so it failed to compile under the project's own
clang++ -std=c++2a build:
- 'concept bool Name' -> 'concept Name'
- return-type-requirement '{expr} -> string' -> '-> std::convertible_to<std::string>'
- 'print(Stringable a)' -> 'print(Stringable auto a)'
Add <concepts> for std::convertible_to. Verified it now compiles and
runs with clang++ -std=c++2a -pedantic.
Fixes #3161 parent 4d3029b commit 482a1c9
1 file changed
Lines changed: 7 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
0 commit comments