Re: [Boost-bugs] [Boost C++ Libraries] #5915: boost::split replaces original data

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5915: boost::split replaces original data
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-12-19 19:09:19


#5915: boost::split replaces original data
---------------------------------+------------------------------------------
  Reporter: mathstuf@… | Owner: pavol_droba
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: string_algo
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------+------------------------------------------

Comment (by marshall):

 Confirmed with 1.48:
 {{{
 #include <stdexcept>
 #include <iostream>
 #include <string>
 #include <vector>

 template <class Container>
 void print ( const Container &c ) {
         std::cout << "{ ";
         for ( typename Container::const_iterator iter = c.begin (); iter
 != c.end (); ++iter )
                 std::cout << *iter << " ";
         std::cout << "}" << std::endl;
         }

 #include <boost/algorithm/string/classification.hpp>
 #include <boost/algorithm/string/split.hpp>

 int main ( int argc, char *argv [] ) {
         std::vector<std::string> nodes;

         nodes.push_back ("z");
         print (nodes);

         boost::split (nodes, "a:b:c", boost::is_any_of(":"));
         print (nodes);

         return 0;
         }
 }}}

 Prints:
 { a b c }

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5915#comment:2>
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:08 UTC