Commit f30fd81
committed
Use C++20 requires clauses in TypeNameGeneratorBase
This addresses the TODOs in src/wasm-type-printing.h by utilizing C++20
concepts and requires clauses.
- Replaced the manual SFINAE/macro-based check in TypeNameGeneratorBase
with a static_assert(requires { ... }) to ensure subclasses implement
getNames correctly. This is cleaner and more robust.
- Updated the ModuleTypeNameGenerator constructor to use a requires
clause instead of std::enable_if_t for its default constructor,
improving readability.
- Added #include <concepts> as required.1 parent b6eba84 commit f30fd81
1 file changed
Lines changed: 6 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
48 | 46 | | |
49 | 47 | | |
50 | 48 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
61 | 52 | | |
62 | 53 | | |
63 | 54 | | |
| |||
123 | 114 | | |
124 | 115 | | |
125 | 116 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 117 | + | |
| 118 | + | |
131 | 119 | | |
132 | 120 | | |
133 | 121 | | |
| |||
0 commit comments