title: Create array of json using boost property_tree
body: <p>I am having troubles with creating array of json using boost library, property tree in C++.</p>
  
  <p>I took as a reference <a href="https://stackoverflow.com/questions/2114466/creating-json-arrays-in-boost-using-property-trees">this</a> thread, especially this part</p>
  
  <pre><code>ptree pt;
  ptree children;
  ptree child1, child2, child3;
  
  
  child1.put("childkeyA", 1);
  child1.put("childkeyB", 2);
  
  child2.put("childkeyA", 3);
  child2.put("childkeyB", 4);
  
  child3.put("childkeyA", 5);
  child3.put("childkeyB", 6);
  
  children.push_back(std::make_pair("", child1));
  children.push_back(std::make_pair("", child2));
  children.push_back(std::make_pair("", child3));
  
  pt.put("testkey", "testvalue");
  pt.add_child("MyArray", children);
  
  write_json("test2.json", pt);
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>{
      "testkey": "testvalue",
      "MyArray":
      [
          {
              "childkeyA": "1",
              "childkeyB": "2"
          },
          {
              "childkeyA": "3",
              "childkeyB": "4"
          },
          {
              "childkeyA": "5",
              "childkeyB": "6"
          }
      ]
  }
  </code></pre>
  
  <p>But what can I do if I want to achieve just simple array without any object containing it? Like this:</p>
  
  <pre><code>[
      {
          "childkeyA": "1",
          "childkeyB": "2"
      },
      {
          "childkeyA": "3",
          "childkeyB": "4"
      },
      {
          "childkeyA": "5",
          "childkeyB": "6"
      }
  ]
  </code></pre>
  
  <p>Thank you a lot.</p>