2
0
mirror of https://github.com/boostorg/pfr.git synced 2026-01-19 04:22:13 +00:00

Update for_each_field.hpp

This commit is contained in:
Antony Polukhin
2026-01-06 20:43:12 +03:00
committed by GitHub
parent 361b8e7d02
commit 93d02b86ce

View File

@@ -42,14 +42,14 @@ constexpr void for_each_field(T&& value, F&& func) {
::boost::pfr::detail::for_each_field_dispatcher(
value,
[f = std::forward<F>(func)](auto&& t) mutable {
[&func](auto&& t) mutable {
// MSVC related workaround. Its lambdas do not capture constexprs.
constexpr std::size_t fields_count_val_in_lambda
= boost::pfr::detail::fields_count<std::remove_reference_t<T>>();
::boost::pfr::detail::for_each_field_impl(
t,
std::forward<F>(f),
std::forward<F>(func),
detail::make_index_sequence<fields_count_val_in_lambda>{},
std::is_rvalue_reference<T&&>{}
);