#15 inheritMembers function for Value class

closed-rejected
nobody
None
5
2015-03-06
2011-12-06
Anonymous
No

I wrote a function that allows a Value to inherit members from another Value, which I'm finding to be very useful, so I thought I should suggest adding it to the library. Here's what it might look like as part of the Value class:

Json::Value&
inheritMembers(Json::Value parent)
{
Json::Value::Members members = getMemberNames();
for( Json::Value::Members::iterator itr = members.begin() ; itr != members.end() ; itr++ ) {
parent[*itr] = this[*itr];
}
return child = parent;
}

Discussion

    • status: open --> closed-rejected
    • Group: --> Next Release (example)