Commit 96e8f19
fix: MSVC compiler compatibility in consteval name-extraction functions
column_field.hpp (tag_to_column_name):
- Add MSVC-specific end delimiters: MSVC __FUNCSIG__ closes the template
argument with '>' (e.g. tag_to_column_name<struct 'anonymous'::tag>)
rather than ';'/'_tag]' used in GCC/Clang __PRETTY_FUNCTION__.
Without this, both end1 and end2 are npos and the static_assert fires.
schema_generator.hpp (extract_type_name):
- Rewrite to use constexpr local variables and ternary expressions in
place of if/else chains. In a consteval function MSVC instantiates
per-type, making each find() result a known compile-time constant;
comparing those against npos in a regular 'if' triggers warning C4127
('conditional expression is constant') which /WX promotes to an error.
Switching to constexpr + ternary eliminates all C4127 warnings.
- Also convert marker_pos/start/end to constexpr so if constexpr can
guard the npos fallback path cleanly.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 3040cd4 commit 96e8f19
2 files changed
Lines changed: 26 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
64 | 70 | | |
65 | 71 | | |
| 72 | + | |
66 | 73 | | |
67 | 74 | | |
68 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
193 | | - | |
| 194 | + | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
209 | 204 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
222 | 213 | | |
223 | 214 | | |
224 | | - | |
| 215 | + | |
225 | 216 | | |
226 | 217 | | |
227 | 218 | | |
| |||
0 commit comments