1.2.2
- Better hash algorithm for small, compile time maps (less collisions means faster compilation)
Quoted Numbers
You can parse quoted JSON numbers directly to types like double
, int
, etc. by utilizing the glz::quoted
wrapper.
struct A {
double x;
std::vector<uint32_t> y;
};
template <>
struct glz::meta<A> {
static constexpr auto value = object("x", glz::quoted<&A::x>(), "y", glz::quoted<&A::y>());
};
{
"x": "3.14",
"y": ["1", "2", "3"]
}
The quoted JSON numbers will be parsed directly into the double
and std::vector<uint32_t>
. The glz::quoted
function works for nested objects and arrays as well.