Boost logo

Boost :

From: Matthew Henderson (M.J.Henderson_at_[hidden])
Date: 2006-01-25 06:26:11


Here is an example of what we observed. This
program compiles and runs without error. The point
here is that, if the behaviour is as described
in the documentation, then we would expect the last
assert to fail, but is succeeds.

#include <vector>
#include <string>
#include <iostream>
#include <cassert>
#include <boost/algorithm/string.hpp>

int main() {
  std::string test_string("a,b,c,d,e");
  std::vector<std::string> test_vector;
  assert( test_vector.size() == 1 );
  assert( test_vector.size() == 5 );

Matthew Henderson

 On Tue, Jan 17, 2006 at 12:04:09PM +0000, Matthew Henderson wrote:
> There are two minor problems with the documentation which I have noticed.
> 1. Undocumented headers.
> boost/algorithm/string/config.hpp
> boost/algorithm/string/iter_find.hpp
> 2. The statement "Each part is copied and added as a new element to the output
> container." which appears both in the documentation of boost/algorithm/string
> /split.hpp and in comments of that header file is not an accurate description
> of what actually happens. Some testing by myself suggests that, in fact, the
> contents of the original container are overwritten.
This is definitely not what the split is supposed to do. Could you please
 send some examples proving your claim. Algorithms in split.hpp does not contain
 any mutating code that I'm aware of.

Boost list run by bdawes at, gregod at, cpdaniel at, john at