Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[struct_json] is compatible with msvc versions #788

Merged
merged 9 commits into from
Oct 10, 2024
2 changes: 1 addition & 1 deletion include/ylt/reflection/member_names.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ get_member_names() {
}
else {
std::array<std::string_view, Count> arr;
#if __cplusplus >= 202002L
#if __cplusplus >= 202002L && (!defined(_MSC_VER) || _MSC_VER >= 1930)
constexpr auto tp = struct_to_tuple<T>();
[&]<size_t... Is>(std::index_sequence<Is...>) mutable {
((arr[Is] =
Expand Down
4 changes: 2 additions & 2 deletions include/ylt/reflection/member_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ 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
#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]), ...);
Expand All @@ -231,7 +231,7 @@ inline constexpr void for_each(T&& t, Visit&& func) {
else if constexpr (std::is_invocable_v<Visit, first_t, std::string_view,
size_t>) {
visit_members(t, [&](auto&... args) {
#if __cplusplus >= 202002L
#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), ...);
Expand Down
Loading