Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenberry committed Sep 24, 2024
1 parent f3fef0f commit b19e14b
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 28 deletions.
11 changes: 5 additions & 6 deletions include/glaze/beve/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace glz
else {
using V = std::remove_cvref_t<T>;
from<BEVE, V>::template op<Opts>(std::forward<T>(value), std::forward<Tag>(tag), std::forward<Ctx>(ctx),
std::forward<It0>(it), std::forward<It1>(end));
std::forward<It0>(it), std::forward<It1>(end));
}
}

Expand All @@ -59,7 +59,7 @@ namespace glz
else {
using V = std::remove_cvref_t<T>;
from<BEVE, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
std::forward<It1>(end));
std::forward<It1>(end));
}
}
};
Expand All @@ -73,7 +73,7 @@ namespace glz
{
using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
from<BEVE, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand Down Expand Up @@ -1274,8 +1274,7 @@ namespace glz
static constexpr auto Length = TargetKey.size();
if ((Length == n) && compare<Length>(TargetKey.data(), key.data())) [[likely]] {
if constexpr (detail::reflectable<T>) {
read<BEVE>::op<Opts>(get_member(value, get<I>(detail::to_tuple(value))), ctx, it,
end);
read<BEVE>::op<Opts>(get_member(value, get<I>(detail::to_tuple(value))), ctx, it, end);
}
else {
read<BEVE>::op<Opts>(get_member(value, get<I>(refl<T>.values)), ctx, it, end);
Expand Down Expand Up @@ -1469,7 +1468,7 @@ namespace glz
[[nodiscard]] inline error_ctx read_binary_untagged(T&& value, Buffer&& buffer) noexcept
{
return read<opts{.format = BEVE, .structs_as_arrays = true}>(std::forward<T>(value),
std::forward<Buffer>(buffer));
std::forward<Buffer>(buffer));
}

template <read_beve_supported T, class Buffer>
Expand Down
8 changes: 4 additions & 4 deletions include/glaze/beve/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,14 @@ namespace glz
GLZ_ALWAYS_INLINE static void op(T&& value, Ctx&& ctx, B&& b, IX&& ix) noexcept
{
to<BEVE, std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}

template <auto Opts, class T, is_context Ctx, class B, class IX>
GLZ_ALWAYS_INLINE static void no_header(T&& value, Ctx&& ctx, B&& b, IX&& ix) noexcept
{
to<BEVE, std::remove_cvref_t<T>>::template no_header<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand All @@ -113,7 +113,7 @@ namespace glz
{
using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
to<BEVE, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand Down Expand Up @@ -947,7 +947,7 @@ namespace glz
[[nodiscard]] error_ctx write_beve_untagged(T&& value, Buffer&& buffer) noexcept
{
return write<opts{.format = BEVE, .structs_as_arrays = true}>(std::forward<T>(value),
std::forward<Buffer>(buffer));
std::forward<Buffer>(buffer));
}

template <write_beve_supported T>
Expand Down
4 changes: 2 additions & 2 deletions include/glaze/core/opts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ namespace glz
{
template <uint32_t Format = INVALID, class T = void>
struct to;

template <uint32_t Format = INVALID, class T = void>
struct to_partial;

template <uint32_t Format = INVALID, class T = void>
struct from;
}
Expand Down
4 changes: 2 additions & 2 deletions include/glaze/csv/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace glz
static void op(T&& value, Ctx&& ctx, It0&& it, It1 end) noexcept
{
from<CSV, std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<It0>(it), std::forward<It1>(end));
std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand All @@ -54,7 +54,7 @@ namespace glz
{
using V = decltype(get_member(std::declval<T>(), meta_wrapper_v<T>));
from<CSV, V>::template op<Opts>(get_member(value, meta_wrapper_v<T>), std::forward<Ctx>(ctx),
std::forward<It0>(it), std::forward<It1>(end));
std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/glaze/csv/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace glz
static void op(T&& value, Ctx&& ctx, B&& b, IX&& ix) noexcept
{
to<CSV, std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand All @@ -32,7 +32,7 @@ namespace glz
{
using V = decltype(get_member(std::declval<T>(), meta_wrapper_v<T>));
to<CSV, V>::template op<Opts>(get_member(value, meta_wrapper_v<T>), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/glaze/json/ndjson.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace glz
static void op(T&& value, Ctx&& ctx, It0&& it, It1&& end)
{
from<NDJSON, std::remove_reference_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<It0>(it), std::forward<It1>(end));
std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand Down Expand Up @@ -159,7 +159,7 @@ namespace glz
static void op(T&& value, Ctx&& ctx, B&& b, IX&& ix)
{
to<NDJSON, std::decay_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand Down
10 changes: 5 additions & 5 deletions include/glaze/json/read.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace glz
else {
using V = std::remove_cvref_t<T>;
from<JSON, V>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx), std::forward<It0>(it),
std::forward<It1>(end));
std::forward<It1>(end));
}
}

Expand Down Expand Up @@ -126,7 +126,7 @@ namespace glz
{
using V = std::decay_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
from<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
std::forward<Ctx>(ctx), std::forward<It0>(it), std::forward<It1>(end));
}
};

Expand Down Expand Up @@ -2730,8 +2730,8 @@ namespace glz
using V = std::decay_t<decltype(v)>;
constexpr bool is_object = glaze_object_t<V> || reflectable<V>;
if constexpr (is_object) {
from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx, it,
end);
from<JSON, V>::template op<opening_handled<Opts>(), tag_literal>(v, ctx,
it, end);
}
else if constexpr (is_memory_object<V>) {
if (!v) {
Expand All @@ -2758,7 +2758,7 @@ namespace glz
}
}
from<JSON, memory_type<V>>::template op<opening_handled<Opts>(),
tag_literal>(*v, ctx, it, end);
tag_literal>(*v, ctx, it, end);
}
},
value);
Expand Down
6 changes: 3 additions & 3 deletions include/glaze/json/write.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace glz
GLZ_ALWAYS_INLINE static void op(T&& value, Ctx&& ctx, B&& b, IX&& ix) noexcept
{
to<JSON, std::remove_cvref_t<T>>::template op<Opts>(std::forward<T>(value), std::forward<Ctx>(ctx),
std::forward<B>(b), std::forward<IX>(ix));
std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand All @@ -41,7 +41,7 @@ namespace glz
{
using V = std::remove_cvref_t<decltype(get_member(std::declval<Value>(), meta_wrapper_v<T>))>;
to<JSON, V>::template op<Opts>(get_member(std::forward<Value>(value), meta_wrapper_v<T>),
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
std::forward<Ctx>(ctx), std::forward<B>(b), std::forward<IX>(ix));
}
};

Expand Down Expand Up @@ -1402,7 +1402,7 @@ namespace glz
}
else {
to<JSON, val_t>::template op<check_opts>(get_member(value, get<I>(refl<T>.values)), ctx, b,
ix);
ix);
}
}
});
Expand Down
3 changes: 1 addition & 2 deletions tests/beve_test/beve_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1904,8 +1904,7 @@ suite read_allocated_tests = [] {
full_struct input{"garbage", "ha!", 400, {1, 2, 3}};
auto s = glz::write_beve(input).value_or("error");
partial_struct obj{};
expect(
!glz::read<glz::opts{.format = glz::BEVE, .error_on_unknown_keys = false, .partial_read = true}>(obj, s));
expect(!glz::read<glz::opts{.format = glz::BEVE, .error_on_unknown_keys = false, .partial_read = true}>(obj, s));
expect(obj.string == "ha!");
expect(obj.integer == 400);
};
Expand Down

0 comments on commit b19e14b

Please sign in to comment.