Boost logo

Boost :

Subject: [boost] [Range] boost::begin() & end( ) for istream?
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2008-10-01 10:15:54


Is there any mechanism to have the boost.range algorithms
iterate over a stream?

Given

    typedef std::istream_iterator<int> in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );

can I write this using range algorithms?

- Thanks, Rob.


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