-
Notifications
You must be signed in to change notification settings - Fork 161
core: add an implementation based on C++26 destructuring into a pack #194
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
base: develop
Are you sure you want to change the base?
Conversation
I'd like to add such a CI configuration, though IDK if there is some github action or VM that easily provides clang@HEAD? |
Pull Request Test Coverage Report for Build 13617014832Details
💛 - Coveralls |
Tested with clang-21
return std::forward_like<const T &>(members...[I]); | ||
#else | ||
return detail::sequence_tuple::get<I>(detail::tie_as_tuple(val)); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
return detail::sequence_tuple::get<I>( detail::tie_as_tuple(val) ); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
return std::move(detail::sequence_tuple::get<I>( detail::tie_as_tuple(val) )); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
return detail::make_stdtuple_from_tietuple( | ||
detail::tie_as_tuple(val), | ||
detail::make_index_sequence< tuple_size_v<T> >() | ||
); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
return detail::make_conststdtiedtuple_from_tietuple( | ||
detail::tie_as_tuple(const_cast<T&>(val)), | ||
detail::make_index_sequence< tuple_size_v<T> >() | ||
); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
); | ||
#if BOOST_PFR_USE_CPP26 | ||
auto &[... members] = val; | ||
return std::tie(std::forward_like<T &>(members)...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You've already implemented detail::tie_as_tuple
which is responsible for that
auto &&[... members] = std::forward<T>(val); | ||
return sequence_tuple::tuple<std::add_lvalue_reference_t<decltype(members)>...>{members...}; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please implement for_each_field_dispatcher
in order to fit the core interface.
std::make_index_sequence<1>{}, | ||
std::is_rvalue_reference<T &&>{}); | ||
} | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant change, please remove it. You should implement detail::for_each_field_dispatcher
as it discussed in another thread, which is responsible for that.
@@ -23,6 +23,43 @@ namespace boost { namespace pfr { namespace detail { | |||
template <std::size_t Index> | |||
using size_t_ = std::integral_constant<std::size_t, Index >; | |||
|
|||
#if BOOST_PFR_USE_CPP26 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It becomens redundat having you removed the change in for_each_field.hpp
. Please remove this change too
Tested with clang-21 HEAD which supports destructuring into a pack and pack indexing <3
I don't know how to use b2 / jam so I added some of the tests with CMake, however that excludes