github stephenberry/glaze v1.2.2
1.2.2

latest releases: v8.3.0, v8.2.0, v8.1.0...
3 years ago
  • 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.

Don't miss a new glaze release

NewReleases is sending notifications on new releases.