#ifndef RFL_ADDSTRUCTNAME_HPP_ #define RFL_ADDSTRUCTNAME_HPP_ #include #include "Field.hpp" #include "Literal.hpp" #include "internal/StringLiteral.hpp" #include "internal/get_type_name.hpp" #include "internal/remove_namespaces.hpp" #include "make_named_tuple.hpp" namespace rfl { template struct AddStructName { /// Adds the name of the struct as a new field. template static auto process(auto&& _view) { using LiteralType = Literal()>()>; using FieldType = Field; const auto add_new_field = [](auto&&... _fields) { return make_named_tuple(FieldType(LiteralType()), std::move(_fields)...); }; return std::apply(add_new_field, std::move(_view.fields())); } }; } // namespace rfl #endif