Re: [Boost-bugs] [Boost C++ Libraries] #7828: use BOOST_FOREACH push_back some thing into vector, the first value is blank.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7828: use BOOST_FOREACH push_back some thing into vector, the first value is blank.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-04 09:16:21


#7828: use BOOST_FOREACH push_back some thing into vector,the first value is
blank.
-----------------------------------+----------------------------------------
  Reporter: yuanzhan@… | Owner: eric_niebler
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: foreach
   Version: Boost 1.50.0 | Severity: Problem
Resolution: | Keywords: BOOST_FOREACH
-----------------------------------+----------------------------------------

Comment (by anonymous):

 Sorry for reply late.
 The file name of xml document is "axml.xml".The content of the file like
 this:
   <?xml version="1.0"
 encoding="UTF-8"?><client_set><client>00801038</client><client>00802980</client><client>01600817</client></client_set>

 My code is like this:

 std::vector<std::string> ClientSet;
 ...
 boost::property_tree::ptree pt;
 try
 {
 boost::property_tree::read_xml("axml.xml",pt);
 ...
 BOOST_FOREACH(boost::property_tree::ptree::value_type &v,
 pt.get_child("client_set"))
       ClientSet.push_back(v.second.data());
 ...
 }
 catch(std::exception & e)
 {
 }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7828#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC