title: C++: How to create an array using boost::property_tree?
body: <p>I don't see a way to create an array using boost::property tree. The following code ...</p>
  
  <pre><code>#include &lt;boost/property_tree/ptree.hpp&gt;
  #include &lt;boost/property_tree/json_parser.hpp&gt;
  
  #include &lt;iostream&gt;
  
  int main()
  {
    try {
      boost::property_tree::ptree props;
      props.push_back(std::make_pair("foo", "bar"));
      props.push_back(std::make_pair("foo", "baz"));
      boost::property_tree::write_json("prob.json", props);
    } catch (const std::exception &amp; ex) {
      std::cout &lt;&lt; ex.what() &lt;&lt; std::endl;
    }
  }
  </code></pre>
  
  <p>... just gives me ...</p>
  
  <pre><code>{
    "foo": "bar",
    "foo": "baz"
  }
  </code></pre>
  
  <p>The docs on boost::property_tree are sparse. How do I create an JSON array with boost::property_tree?</p>