Skip to content

Commit

Permalink
Apply clang-format suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
RAVER0306 committed Oct 10, 2024
1 parent 6918255 commit 0274573
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/ylt/reflection/member_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,28 +215,35 @@ inline constexpr void for_each(T&& t, Visit&& func) {
else {
if constexpr (std::is_invocable_v<Visit, first_t, std::string_view>) {
visit_members(t, [&](auto&... args) {
#if __cplusplus >= 202002L && (!defined(_MSC_VER) || _MSC_VER >= 1930)
#if __cplusplus >= 202002L && (!defined(_MSC_VER) || _MSC_VER >=
1930)
[&]<size_t... Is>(std::index_sequence<Is...>) mutable {
constexpr auto arr = get_member_names<T>();
(func(args, arr[Is]), ...);
}
(std::make_index_sequence<sizeof...(args)>{});
#else
visit_members_impl0<T>(std::forward<Visit>(func), std::make_index_sequence<sizeof...(args)>{}, args...);
visit_members_impl0<T>(std::forward<Visit>(func),
std::make_index_sequence<sizeof...(args)>{},
args...);

#endif
});
}
else if constexpr (std::is_invocable_v<Visit, first_t, std::string_view,
size_t>) {
visit_members(t, [&](auto&... args) {
#if __cplusplus >= 202002L && (!defined(_MSC_VER) || _MSC_VER >= 1930)
#if __cplusplus >= 202002L && (!defined(_MSC_VER) || _MSC_VER >=
1930)
[&]<size_t... Is>(std::index_sequence<Is...>) mutable {
constexpr auto arr = get_member_names<T>();
(func(args, arr[Is], Is), ...);
}
(std::make_index_sequence<sizeof...(args)>{});
#else
visit_members_impl<T>(std::forward<Visit>(func), std::make_index_sequence<sizeof...(args)>{}, args...);
visit_members_impl<T>(std::forward<Visit>(func),
std::make_index_sequence<sizeof...(args)>{},
args...);
#endif
});
}
Expand Down

0 comments on commit 0274573

Please sign in to comment.