title: Boost ptree reused need to be cleared or not?
body: <p>I have written the following code (for testing):</p>
  
  <pre><code>boost::property_tree::ptree ptRes;
  boost::property_tree::ptree ptRes2;
  boost::property_tree::ptree ptRes3;
  boost::property_tree::ptree ptA;
  boost::property_tree::ptree ptB;
  boost::property_tree::ptree ptQ;
  boost::property_tree::ptree ptZ;
  
  boost::property_tree::json_parser::read_json("../a.json", ptA);
  boost::property_tree::json_parser::read_json("../b.json", ptB);
  ptRes.put_child("ptA", ptA);
  ptRes.put_child("ptB", ptB);
  boost::property_tree::json_parser::write_json("res.json", ptRes);
  
  boost::property_tree::json_parser::read_json("../a.json", ptQ);
  ptRes2.put_child("ptA", ptQ);
  boost::property_tree::json_parser::read_json("../b.json", ptQ);
  ptRes2.put_child("ptB", ptQ);
  boost::property_tree::json_parser::write_json("res2q.json", ptRes2);
  
  boost::property_tree::json_parser::read_json("../a.json", ptZ);
  ptRes3.put_child("ptA", ptZ);
  ptZ.clear();
  boost::property_tree::json_parser::read_json("../b.json", ptZ);
  ptRes3.put_child("ptB", ptZ);
  boost::property_tree::json_parser::write_json("res3z.json", ptRes3);
  </code></pre>
  
  <p>but the output is the same in all the 3 cases. My problem is that I want to create a <code>ptree</code> that contains 3 other <code>ptree</code>s and I am not really sure how to do it better (in the json reading part):</p>
  
  <ul>
  <li>reading each file in a different <code>ptree</code></li>
  <li>reading each file in the same <code>ptree</code></li>
  <li>reading each file in the same <code>ptree</code>, but clear each time the <code>ptree</code></li>
  </ul>
  
  <p>I do this in the constructor of a class that has a member of type <code>ptree</code> and I would not create another 3 <code>ptree</code>s if not needed. Any suggestions?</p>