0

I am searching for an effective way to access to deeply nested element in JSON.
Let's say:

{
  "parent": [
    0,
    {
      "child": "nested elem"
    },
    "string"
  ]
}

I want to access to the "nested element" with a JSON pointer/url : /parent/1/child

I have tried a recusive function that check at each node if the value is an array or an object (structured) and get the nested value but it involved a lot of copies and I thought that it might be a better way.

I am aware of boost::json::value::at_pointer(), it would do the job perfectly but I'm stuck with Boost::Json 1.75 and I cannot upgrade to 1.81 for some reasons.

Thank you for you'r help !

0 Answers0