diff --git a/include/glaze/core/refl.hpp b/include/glaze/core/refl.hpp index d947404e6e..7c26629dbd 100644 --- a/include/glaze/core/refl.hpp +++ b/include/glaze/core/refl.hpp @@ -1639,17 +1639,17 @@ namespace glz::detail return std::memchr(it, '"', size_t(end - it)); } } - + template struct decode_hash; - + template struct decode_hash { static constexpr auto N = refl.N; static constexpr auto bsize = bucket_size(hash_type::unique_index, N); static constexpr auto uindex = HashInfo.unique_index; - + GLZ_ALWAYS_INLINE static constexpr size_t op(auto&& it, auto&& end) noexcept { if constexpr (HashInfo.sized_hash) { @@ -1695,13 +1695,13 @@ namespace glz::detail } } }; - + template struct decode_hash { static constexpr auto N = refl.N; static constexpr auto uindex = HashInfo.unique_index; - + GLZ_ALWAYS_INLINE static constexpr size_t op(auto&& it, auto&& end) noexcept { if constexpr (uindex > 0) { @@ -1720,13 +1720,13 @@ namespace glz::detail } } }; - + template struct decode_hash { static constexpr auto N = refl.N; static constexpr auto bsize = bucket_size(hash_type::front_hash, N); - + GLZ_ALWAYS_INLINE static constexpr size_t op(auto&& it, auto&& end) noexcept { if constexpr (HashInfo.front_hash_bytes == 2) { @@ -1782,13 +1782,13 @@ namespace glz::detail } } }; - + template struct decode_hash { static constexpr auto N = refl.N; static constexpr auto bsize = bucket_size(hash_type::unique_per_length, N); - + GLZ_ALWAYS_INLINE static constexpr size_t op(auto&& it, auto&& end) noexcept { const auto* c = quote_memchr(it, end); @@ -1806,13 +1806,13 @@ namespace glz::detail } } }; - + template struct decode_hash { static constexpr auto N = refl.N; static constexpr auto bsize = bucket_size(hash_type::full_flat, N); - + GLZ_ALWAYS_INLINE static constexpr size_t op(auto&& it, auto&& end) noexcept { const auto* c = quote_memchr(it, end); diff --git a/include/glaze/json/write.hpp b/include/glaze/json/write.hpp index 8cb379582e..1697db1d27 100644 --- a/include/glaze/json/write.hpp +++ b/include/glaze/json/write.hpp @@ -1545,7 +1545,7 @@ namespace glz if constexpr ((num_members > 0) && (glaze_object_t || reflectable)) { static constexpr auto HashInfo = hash_info; - + invoke_table([&]() { if (bool(ctx.error)) [[unlikely]] { return; @@ -1560,7 +1560,8 @@ namespace glz dump(b, ix); static constexpr auto sub_partial = get<1>(group); - static constexpr auto index = decode_hash::op(key.data(), key.data() + key.size()); + static constexpr auto index = + decode_hash::op(key.data(), key.data() + key.size()); static_assert(index < num_members, "Invalid key passed to partial write"); if constexpr (glaze_object_t) { static constexpr auto member = get(refl.values); @@ -1571,7 +1572,8 @@ namespace glz } } else { - write_partial::op(get_member(value, get(to_tuple(value))), ctx, b, ix); + write_partial::op(get_member(value, get(to_tuple(value))), ctx, b, + ix); if constexpr (I != N - 1) { write_object_entry_separator(ctx, b, ix); } diff --git a/tests/json_test/json_test.cpp b/tests/json_test/json_test.cpp index fdf173d95f..d0354661c2 100644 --- a/tests/json_test/json_test.cpp +++ b/tests/json_test/json_test.cpp @@ -8133,7 +8133,7 @@ suite partial_write_tests = [] { expect(!ec); expect(s == R"({"animals":{"tiger":"Tiger"},"name":"My Awesome Zoo"})") << s; }; - + "partial write const qualified"_test = [] { static constexpr auto partial = glz::json_ptrs("/name", "/animals/tiger"); @@ -8143,7 +8143,7 @@ suite partial_write_tests = [] { expect(!ec); expect(s == R"({"animals":{"tiger":"Tiger"},"name":"My Awesome Zoo"})") << s; }; - + "reflection partial write const qualified"_test = [] { static constexpr auto partial = glz::json_ptrs("/name", "/animals/tiger");