I have a function where I would like to pass a rapidjson::GenericObject
as a parameter, e.g.
MyObject readObject(rapidjson::GenericObject<true/false, rapidjson::Value>& obj)
{
// ...
}
However, depending on how I extract the object, GenericObject
is either const
or not.
For example, it is
- When extracting from an array
rapidjson::GenericObject<true, rapidjson::Value> // true
- When extracting from a doc
rapidjson::GenericObject<false, rapidjson::Value> // false
How can I have a function that can take both types of objects (true
and false
) so that I can then extract the members from it for further processing?