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 Dec 14, 2024
1 parent 1a183a1 commit c2f7d7c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions include/glaze/core/reflect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@ namespace glz
namespace glz
{
// The Callable comes second as ranges::for_each puts the callable at the end

template <class Callable, detail::reflectable T>
void for_each_field(T&& value, Callable&& callable)
{
Expand All @@ -2215,7 +2215,7 @@ namespace glz
}(std::make_index_sequence<N>{});
}
}

template <class Callable, detail::glaze_object_t T>
void for_each_field(T&& value, Callable&& callable)
{
Expand Down
26 changes: 12 additions & 14 deletions tests/reflection/reflection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@

using namespace ut;

struct test_type {
struct test_type
{
int32_t int1{};
int64_t int2{};
};

suite reflect_test_type = [] {
static_assert(glz::reflect<test_type>::size == 2);
static_assert(glz::reflect<test_type>::keys[0] == "int1");

"for_each_field"_test = [] {
test_type var{42, 43};

glz::for_each_field(var, [](auto& field) {
field += 1;
});


glz::for_each_field(var, [](auto& field) { field += 1; });

expect(var.int1 == 43);
expect(var.int2 == 44);
};
};

struct test_type_meta {
struct test_type_meta
{
int32_t int1{};
int64_t int2{};
};
Expand All @@ -43,14 +43,12 @@ struct glz::meta<test_type_meta>
suite meta_reflect_test_type = [] {
static_assert(glz::reflect<test_type_meta>::size == 2);
static_assert(glz::reflect<test_type_meta>::keys[0] == "int1");

"for_each_field"_test = [] {
test_type_meta var{42, 43};

glz::for_each_field(var, [](auto& field) {
field += 1;
});


glz::for_each_field(var, [](auto& field) { field += 1; });

expect(var.int1 == 43);
expect(var.int2 == 44);
};
Expand Down

0 comments on commit c2f7d7c

Please sign in to comment.