[Boost-bugs] [Boost C++ Libraries] #4206: Usage documentation for string_algo split does not work as advertised

Subject: [Boost-bugs] [Boost C++ Libraries] #4206: Usage documentation for string_algo split does not work as advertised
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-12 07:47:23


#4206: Usage documentation for string_algo split does not work as advertised
--------------------------------------------------------+-------------------
 Reporter: Steven Sims <steven.sims@…> | Owner: pavol_droba
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: string_algo
  Version: Boost 1.44.0 | Severity: Cosmetic
 Keywords: |
--------------------------------------------------------+-------------------
 Sorry that this is so trivial, but it has been around for years...

 In doc/html/string_algo/usage.html#id1761650

     string str1("hello abc-*-ABC-*-aBc goodbye");
 [snip]
     split( SplitVec, str1, is_any_of("-*") ); // SplitVec == { "hello
 abc","ABC","aBc goodbye" }

 No it isn't; the result includes empty strings because of the grouped
 separators in "-*-". To produce the 3 strings as in the comment needs:

    split( SplitVec, str1, is_any_of("-*"), token_compress_on );

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