Conversation
| { | ||
| from_variant( it->value(), (value.*member), _max_depth ); | ||
| assert( count_left > 0 ); // x.find(k) returns true for n distinct values of k only if x.size() >= n | ||
| FC_ASSERT( count_left > 0 ); // x.find(k) returns true for n distinct values of k only if x.size() >= n |
There was a problem hiding this comment.
Please add a meaningful error message.
Actually I can't think of a situation where this assertion would trigger.
The visitor is called once per extension member, with distinct names. Only names that are found are counted, so the only way to have count_left == 0 is to call it more than once with a given name.
The only case I can think of where this could happen is if the extension type is a derived class, and both the parent and the extension have a member with the same name. Or if a member name appears more than once in the corresponding FC_REFLECT macro. Both would be a bug in core, not a problem with the incoming variant.
|
I think what will be more important for API users is error messages in the |
#1755
In the last core team meeting @nathanhourt explained he is not sure on the use of extension option to do named arguments. He will do more research as he haves other options.
Still, i think this can still be changed and it is what this pull do.