diff --git a/include/toml++/impl/array.h b/include/toml++/impl/array.h index 29c9168b..583ae0d2 100644 --- a/include/toml++/impl/array.h +++ b/include/toml++/impl/array.h @@ -887,7 +887,10 @@ TOML_NAMESPACE_START const auto keep_going = static_cast(static_cast(arr)[i]) .visit( - [&](auto&& elem) noexcept(for_each_is_nothrow_one) + [&](auto&& elem) +#if !TOML_MSVC || TOML_MSVC >= 1932 // older MSVC thinks this is invalid syntax O_o + noexcept(for_each_is_nothrow_one) +#endif { using elem_ref = for_each_elem_ref; static_assert(std::is_reference_v); diff --git a/include/toml++/impl/table.h b/include/toml++/impl/table.h index b5648385..e5d6eda0 100644 --- a/include/toml++/impl/table.h +++ b/include/toml++/impl/table.h @@ -899,7 +899,10 @@ TOML_NAMESPACE_START const auto keep_going = static_cast(*kvp.second) .visit( - [&](auto&& v) noexcept(for_each_is_nothrow_one) + [&](auto&& v) +#if !TOML_MSVC || TOML_MSVC >= 1932 // older MSVC thinks this is invalid syntax O_o + noexcept(for_each_is_nothrow_one) +#endif { using value_ref = for_each_value_ref; static_assert(std::is_reference_v); diff --git a/toml.hpp b/toml.hpp index 234ef235..d2e0e28d 100644 --- a/toml.hpp +++ b/toml.hpp @@ -5625,7 +5625,10 @@ TOML_NAMESPACE_START const auto keep_going = static_cast(static_cast(arr)[i]) .visit( - [&](auto&& elem) noexcept(for_each_is_nothrow_one) + [&](auto&& elem) +#if !TOML_MSVC || TOML_MSVC >= 1932 // older MSVC thinks this is invalid syntax O_o + noexcept(for_each_is_nothrow_one) +#endif { using elem_ref = for_each_elem_ref; static_assert(std::is_reference_v); @@ -6931,7 +6934,10 @@ TOML_NAMESPACE_START const auto keep_going = static_cast(*kvp.second) .visit( - [&](auto&& v) noexcept(for_each_is_nothrow_one) + [&](auto&& v) +#if !TOML_MSVC || TOML_MSVC >= 1932 // older MSVC thinks this is invalid syntax O_o + noexcept(for_each_is_nothrow_one) +#endif { using value_ref = for_each_value_ref; static_assert(std::is_reference_v);