[Boost-bugs] [Boost C++ Libraries] #3461: bug in iter_split or nth_finder

Subject: [Boost-bugs] [Boost C++ Libraries] #3461: bug in iter_split or nth_finder
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-17 14:53:47


#3461: bug in iter_split or nth_finder
----------------------------------------------+-----------------------------
 Reporter: cwadswor@… | Owner: pavol_droba
     Type: Bugs | Status: new
Milestone: Boost 1.41.0 | Component: string_algo
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
----------------------------------------------+-----------------------------
 There appears to be a bug in iter_split or nt_finder.

 Sample code:
 #include <iostream>
 #include <string>
 #include <vector>
 #include <boost/algorithm/string.hpp>

 int main() {
         std::string str("Hello, world, !!!");
         std::vector<std::string> slist;

         boost::algorithm::iter_split(slist, str,
 boost::algorithm::nth_finder(", ", 0));

         for(int index=0; index<str.length(); ++index)
                 std::cout << slist[index] << std::endl;


         return 0;
 }

 Output:
 Hello
 world
 !!!

 Expected Output:
 Hello
 world, !!!

 All other indices seem to work, only when you use 0.

 This also happens on boost 1.37.0, so its possible it could be in every
 version in between.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3461>
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:01 UTC