mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-06 02:36:18 +08:00
revert change of F&& to const F&
This commit is contained in:
@@ -199,7 +199,7 @@ class NamedTuple {
|
||||
|
||||
/// Invokes a callable object once for each field in order.
|
||||
template <typename F>
|
||||
void apply(const F& _f) {
|
||||
void apply(F&& _f) {
|
||||
const auto apply_to_field =
|
||||
[&_f]<typename... AFields>(AFields&&... fields) {
|
||||
((_f(std::forward<AFields>(fields))), ...);
|
||||
@@ -209,7 +209,7 @@ class NamedTuple {
|
||||
|
||||
/// Invokes a callable object once for each field in order.
|
||||
template <typename F>
|
||||
void apply(const F& _f) const {
|
||||
void apply(F&& _f) const {
|
||||
const auto apply_to_field = [&_f](const auto&... fields) {
|
||||
((_f(fields)), ...);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user