5
5
#include < type_traits>
6
6
7
7
#include " rfl/field_names_t.hpp"
8
+ #include " rfl/internal/bind_to_tuple.hpp"
8
9
#include " rfl/internal/flattened_ptr_tuple_t.hpp"
9
10
#include " rfl/internal/has_fields.hpp"
10
11
#include " rfl/internal/is_flatten_field.hpp"
11
12
#include " rfl/internal/is_named_tuple.hpp"
12
13
#include " rfl/internal/lit_name.hpp"
13
- #include " rfl/internal/move_to_field_tuple_impl.hpp"
14
14
15
15
namespace rfl {
16
16
namespace internal {
@@ -21,7 +21,6 @@ auto wrap_in_fields(auto&& _tuple, Fields&&... _fields) {
21
21
constexpr auto i = sizeof ...(_fields);
22
22
if constexpr (i == size) {
23
23
return std::make_tuple (std::move (_fields)...);
24
-
25
24
} else {
26
25
auto value = std::move (std::get<i>(_tuple));
27
26
using Type = std::decay_t <decltype (value)>;
@@ -49,10 +48,10 @@ auto move_to_field_tuple(OriginalStruct&& _t) {
49
48
if constexpr (internal::is_named_tuple_v<T>) {
50
49
return _t.fields ();
51
50
} else if constexpr (has_fields<T>()) {
52
- return move_to_field_tuple_impl ( std::move (_t) );
51
+ return bind_to_tuple (_t, []( auto & x) { return std::move (x); } );
53
52
} else {
54
53
using FieldNames = field_names_t <T>;
55
- auto tup = move_to_field_tuple_impl ( std::move (_t) );
54
+ auto tup = bind_to_tuple (_t, []( auto & x) { return std::move (x); } );
56
55
return wrap_in_fields<FieldNames>(std::move (tup));
57
56
}
58
57
}
0 commit comments