Boost logo

Boost :

From: jeff_at_[hidden]
Date: 2001-06-01 18:49:20


> -----Original Message-----
> From: jbandela_at_[hidden] [mailto:jbandela_at_[hidden]]
>
> Yes. Use const char* instead of string::const_iterator as the
> iterator argument. Leave all the other parameters the same. It will
> take the cstring and break it up into a series of strings.

Thanks. This might make an illustrative example of how to use something other
than just strings.

const char test_chars[] = "This,,is, a.test..";

// Use the convenience token_iterator
  typedef token_iterator<string,const char*,punct_space_separator<char> >
CharTokType;
  CharTokType begin(&test_chars[0],&test_chars[17]), end;
  copy(begin, end,ostream_iterator<string>(cout,"|"));
  cout << "\n";

Jeff


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk