title: JSONcpp iterate through a list within the object
body: <p>My json object has a list in it and I would like to iterate through the elements of the list
  I saw the following post <a href="https://stackoverflow.com/questions/4800605/jsoncpp-iterate-thru-all-the-objects">Iterating through objects in JsonCpp</a> , but this did not work for me</p>
  
  <p>My json object:</p>
  
  <pre><code>{
           "name": ["str1",str2" ... ]
  }
  </code></pre>
  
  <p>The code that I have and is not working</p>
  
  <pre><code>Json::Value names= (*json)["name"];
  for( Json::ValueIterator itr = names.begin() ; itr != names.end() ; itr++ ) {
      string name =  *itr.asString();}
  </code></pre>
  
  <p>I am getting the following error </p>
  
  <pre><code>cannot convert from 'Json::Value' to 'std::basic_string&lt;_Elem,_Traits,_Ax&gt;
  </code></pre>
  
  <p>I am sure the elements are string because calling <code>string name = names= (*json)["name"][0].asString()</code> is working </p>