Commit d4e4a67
committed
Attempt the stronger is_standard_layout guard, isolated for CI (#21)
Adds static_assert(std::is_standard_layout<REFLECTABLE>::value, ...)
immediately after the polymorphic guard, as its own commit so a CI failure
on any platform isolates cleanly to this one static_assert.
is_standard_layout on REFLECTABLE is only true if std::wstring and
TimePoint both happen to be standard-layout on the active standard library,
which is implementation-defined. Verified true here on Ubuntu/GCC/libstdc++
in both C++11 and C++20 (matching the issue's own measurement), for all
four representative test records (Person, Pet, Company,
DatetimeContainer). NOT verified in this environment on libc++ (macOS) or
MSVC (Windows) - this sandbox can only build for Linux/GCC.
If CI is green on macOS and Windows (both C++11 and C++20) for this commit,
#21 is fully closed. If it fails on either, revert just this commit,
keeping the polymorphic guard from the prior commit, and note here that the
standard-layout assert is blocked pending #25 (moving the text
representation off std::wstring).
Also adds a mirroring ReflectionTest.ReflectableRecordsAreStandardLayout
runtime test alongside the compile-time check.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUt3c1wdseRtRSSXfg3MCK1 parent 8cb6120 commit d4e4a67
2 files changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
206 | 215 | | |
207 | 216 | | |
208 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
0 commit comments