Breaking Change
glaze/json/study.hppmust now be explicitly included. It is not included by default inglaze/json.hpporglaze/glaze.hpp, in order to remove threading dependencies for most users.- This only affects users implementing the study tools, which is not common.
- by @stephenberry in #811
Improvements
- cli_menu provides more help about the expected type by @stephenberry in #810
- Faster and cleaner code for naming std types by @stephenberry in #813
- Adding partial write support for JSON like binary by @stephenberry in #815
Example of partial writing:
struct animals_t
{
std::string lion = "Lion";
std::string tiger = "Tiger";
std::string panda = "Panda";
struct glaze
{
using T = animals_t;
static constexpr auto value = glz::object(&T::lion, &T::tiger, &T::panda);
};
};
struct zoo_t
{
animals_t animals{};
std::string name{"My Awesome Zoo"};
struct glaze
{
using T = zoo_t;
static constexpr auto value = glz::object(&T::animals, &T::name);
};
};
"partial write"_test = [] {
static constexpr auto partial = glz::json_ptrs("/name", "/animals/tiger");
zoo_t obj{};
std::string s{};
const auto ec = glz::write_json<partial>(obj, s);
expect(!ec);
expect(s == R"({"animals":{"tiger":"Tiger"},"name":"My Awesome Zoo"})") << s;
};Fixes
- Using native path for LoadLibraryW by @stephenberry in #814
Full Changelog: v2.2.1...v2.2.2