#ifndef RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ #define RFL_INTERNAL_COPY_FLATTENED_TUPLE_TO_NAMED_TUPLE_HPP_ #include #include #include #include "../Field.hpp" #include "../make_named_tuple.hpp" #include "lit_name.hpp" namespace rfl { namespace internal { template auto copy_flattened_tuple_to_named_tuple(const auto& _flattened_tuple, Fields&&... _fields) { constexpr auto size = std::tuple_size_v>; constexpr auto i = sizeof...(_fields); if constexpr (i == size) { return make_named_tuple(std::move(_fields)...); } else { const auto name_literal = FieldNames::template name_of(); auto new_field = rfl::make_field>>( std::get(_flattened_tuple) ); return copy_flattened_tuple_to_named_tuple( _flattened_tuple, std::move(_fields)..., std::move(new_field) ); } } } // namespace internal } // namespace rfl #endif