-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
In a struct if you have a field that is being renamed to another field that is skipped, rfl will still refuse to process it. Example:
struct Config
{
rfl::Rename<"items", std::vector<int>> all_items;
rfl::Skip<std::vector<int>> items;
}
int main()
{
rfl::json::read<Config>("{ \"items\": [ 1, 2, 3 ]}");
return 0;
}
It ends up dumping the following errors for me:
C:\Users\laz\Documents\projects\FLHook\vendor\reflect-cpp\include\rfl\internal/no_duplicate_field_names.hpp(22): error C2338: static_assert failed: 'Duplicate field names are not allowed in either named tuples or Literals.'
C:\Users\laz\Documents\projects\FLHook\vendor\reflect-cpp\include\rfl\internal/no_duplicate_field_names.hpp(35): note: while evaluating constexpr function 'rfl::internal::no_duplicate_field_names_helpers::iterate_over_j'
C:\Users\laz\Documents\projects\FLHook\vendor\reflect-cpp\include\rfl\internal/no_duplicate_field_names.hpp(46): note: while evaluating constexpr function 'rfl::internal::no_duplicate_field_names_helpers::iterate_over_i'
C:\Users\laz\Documents\projects\FLHook\vendor\reflect-cpp\include\rfl\Literal.hpp(128): note: while evaluating constexpr function 'rfl::internal::no_duplicate_field_names'
C:\Users\laz\Documents\projects\FLHook\vendor\reflect-cpp\include\rfl\Literal.hpp(358): note: while evaluating constexpr function 'rfl::Literal<rfl::internal::StringLiteral<9>{std::array<char,9>{_Ty114,101,112,71,114,111,117,112,0}},rfl::internal::StringLiteral<10>{std::array<_Ty,10>{_Ty108,111,99,97,116,105,111,110,115,0}},rfl::internal::StringLiteral<12>{std::array<_Ty,12>{_Ty115,112,97,119,110,67,104,97,110,99,101,0}},rfl::internal::StringLiteral<12>{std::array<_Ty,12>{_Ty114,101,115,112,97,119,110,84,105,109,101,0}},rfl::internal::StringLiteral<14>{std::array<_Ty,14>{_Ty104,117,108,108,82,101,103,101,110,84,105,109,101,0}},rfl::internal::StringLiteral<10>{std::array<_Ty,10>{_Ty104,117,108,108,82,101,103,101,110,0}},rfl::internal::StringLiteral<11>{std::array<_Ty,11>{_Ty115,112,97,119,110,67,111,117,110,116,0}},rfl::internal::StringLiteral<11>{std::array<_Ty,11>{_Ty102,111,114,109,97,116,105,111,110,115,0}},rfl::internal::StringLiteral<17>{std::array<_Ty,17>{_Ty102,111,114,109,97,116,105,111,110,87,101,105,103,104,116,115,0}},rfl::internal::StringLiteral<11>{std::array<_Ty,11>{_Ty102,111,114,109,97,116,105,111,110,115,0}}>::has_duplicates'
with
[
_Ty=char
]
If you are curious as to the use case for this, in reference of #426, I am looking to load a collection of objects and then reuse them. So I have one list of ids and then I'd use that to populate the skipped value.
Metadata
Metadata
Assignees
Labels
No labels