- New logging structures (currently only writing is supported):
Sometimes you just want to write out JSON structures on the fly as efficiently as possible. Glaze provides tuple-like structures that allow you to stack allocate structures to write out JSON with high speed. These structures are named glz::obj for objects and glz::arr for arrays.
Below is an example of building an object, which also contains an array, and writing it out.
auto obj = glz::obj{"pi", 3.14, "happy", true, "name", "Stephen", "arr", glz::arr{"Hello", "World", 2}};
std::string s{};
glz::write_json(obj, s);
expect(s == R"({"pi":3.14,"happy":true,"name":"Stephen","arr":["Hello","World",2]})");This approach is significantly faster than
glz::json_tfor generic JSON. But, may not be suitable for all contexts.
- Fixed prettify of tagged variants (@justend29)
- Support for parsing empty sets (@justend29)
- Added support for modern C++ modules (@katazina0)