mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-07 03:06:18 +08:00
Feat/286/std expected (#340)
This commit is contained in:
@@ -17,14 +17,14 @@ template <internal::StringLiteral field_name_>
|
||||
struct AddStructName {
|
||||
/// Adds the name of the struct as a new field.
|
||||
template <class StructType>
|
||||
static auto process(auto&& _view) {
|
||||
static auto process(const auto& _view) {
|
||||
using LiteralType = Literal<
|
||||
internal::remove_namespaces<internal::get_type_name<StructType>()>()>;
|
||||
using FieldType = Field<field_name_, LiteralType>;
|
||||
const auto add_new_field = [](auto&&... _fields) {
|
||||
return make_named_tuple(FieldType(LiteralType()), std::move(_fields)...);
|
||||
const auto add_new_field = [](const auto&... _fields) {
|
||||
return make_named_tuple(FieldType(LiteralType()), _fields...);
|
||||
};
|
||||
return rfl::apply(add_new_field, std::move(_view.fields()));
|
||||
return rfl::apply(add_new_field, _view.fields());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user