Boost logo

Boost :

From: jbandela_at_[hidden]
Date: 2001-08-03 18:06:47


You should be able to provided the Tokenizer Function you use works
with input iterators. I believe all 3 Tokenizer Functions in
token_functions.hpp work with input iterators.

The following code should work.

#include <boost/tokenizer.hpp>
#include <iostream>
#include <string>
#include <algorithm>

int main(){
using namespace boost;
using namespace std;
typedef
tokenizer<char_delimiters_separator<char>,istream_iterator<char> >
Tok;

Tok t(istream_iterator<char>(cin),istream_iterator<char>());

copy(t.begin(),t.end(),ostream_iterator<string>(cout,"\n"));

return 0;

}
--- In boost_at_y..., "Gennadiy E. Rozental" <rogeeff_at_m...> wrote:
> Hi!
>
> Can I use tokenizer to tokenize istream?
>
> Gennadiy.


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