@@ -19,7 +19,7 @@ namespace rfl {
1919namespace internal {
2020
2121template <class PtrFieldTuple , class ... Args>
22- auto flatten_ptr_field_tuple (const PtrFieldTuple& _t, Args&&... _args) {
22+ auto flatten_ptr_field_tuple (PtrFieldTuple& _t, Args&&... _args) {
2323 constexpr auto i = sizeof ...(Args);
2424 if constexpr (i == std::tuple_size_v<std::decay_t <PtrFieldTuple>>) {
2525 return std::tuple_cat (std::forward<Args>(_args)...);
@@ -38,7 +38,7 @@ auto flatten_ptr_field_tuple(const PtrFieldTuple& _t, Args&&... _args) {
3838}
3939
4040template <class PtrFieldTuple >
41- auto field_tuple_to_named_tuple (const PtrFieldTuple& _ptr_field_tuple) {
41+ auto field_tuple_to_named_tuple (PtrFieldTuple& _ptr_field_tuple) {
4242 const auto ft_to_nt = []<class ... Fields>(const Fields&... _fields) {
4343 return make_named_tuple (_fields...);
4444 };
@@ -54,19 +54,19 @@ auto field_tuple_to_named_tuple(const PtrFieldTuple& _ptr_field_tuple) {
5454// / Generates a named tuple that contains pointers to the original values in
5555// / the struct.
5656template <class T >
57- auto to_ptr_named_tuple (const T & _t) {
57+ auto to_ptr_named_tuple (T& & _t) {
5858 if constexpr (has_fields<std::decay_t <T>>()) {
5959 if constexpr (std::is_pointer_v<std::decay_t <T>>) {
6060 return to_ptr_named_tuple (*_t);
6161 } else if constexpr (is_named_tuple_v<std::decay_t <T>>) {
6262 return nt_to_ptr_named_tuple (_t);
6363 } else {
64- const auto ptr_field_tuple = to_ptr_field_tuple (_t);
64+ auto ptr_field_tuple = to_ptr_field_tuple (_t);
6565 return field_tuple_to_named_tuple (ptr_field_tuple);
6666 }
6767 } else {
6868 using FieldNames = rfl::field_names_t <T>;
69- const auto flattened_ptr_tuple = to_flattened_ptr_tuple (_t);
69+ auto flattened_ptr_tuple = to_flattened_ptr_tuple (_t);
7070 return copy_flattened_tuple_to_named_tuple<FieldNames>(flattened_ptr_tuple);
7171 }
7272}
0 commit comments