title: Iterate over items in Boost Property Tree
body: <p>I'm using boost property tree to store configuration data for my application.</p>
  
  <p>In the configuration file I have an item named that looks like this.
  I'm wondering how I can iterate over the ServerList.</p>
  
  <pre><code>ServerList
  {
     server1 127.0.0.1:5000
     server2 example.com
  }
  </code></pre>
  
  <p>By the way the solution provided here, didn't seem to work for me:
  <a href="https://stackoverflow.com/questions/1794418/boost-property-tree-and-xml-parsing-problems">Boost Property Tree and Xml parsing Problems</a>
  So don't go and requote that.  When I tried it I got this error:</p>
  
  <pre><code>config.cpp:47: error: invalid initialization of reference of type ‘boost::property_tree::wiptree&amp;’ from expression of type ‘boost::property_tree::basic_ptree&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, std::less&lt;std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt; &gt;’
  make: *** [config.o] Error 1
  </code></pre>