Opened 12 years ago

Closed 12 years ago

#4206 closed Bugs (fixed)

Usage documentation for string_algo split does not work as advertised

Reported by: Steven Sims <steven.sims@…> Owned by: Pavol Droba
Milestone: Boost 1.43.0 Component: string_algo
Version: Boost 1.44.0 Severity: Cosmetic
Keywords: Cc:

Description

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 );

Change History (1)

comment:1 by Steven Watanabe, 12 years ago

Resolution: fixed
Status: newclosed

(In [61931]) Fix example. Fixes #4206

Note: See TracTickets for help on using tickets.