Open frederick-vs-ja opened 3 months ago
It seems that type erasure is desired for node types, which is incompatible with constant evaluation until C++26.
Bullet 1 is resolved and bullet 2 is ~mute~ moot. So the remaining work seems to be adding a constexpr
map container for test or product...
Edit: See also WG21 P3372.
reinterpret_cast
s betweennode_type
andjson_type
.reinterpret_cast
is very likely to (although not always) result in UB here, and it always breaks constant evaluation.stor_t
storesvoid*
pointers, andstatic_cast
from it to (the correct) concrete pointer types isn't constant-evaluation-compatible until C++26. Same for several occurences of placement-new.std::map
is currently used as default template arguments but not yetconstexpr
. Not sure whether there should be aconstexpr
variant ofstd::map
to makebasic_json
fully usable in constant evaluation by default at this moment.