I found a simple code:
using namespace boost::lambda;
typedef std::istream_iterator<int> in;
std::for_each(
in(std::cin), in(), std::cout << (_1 * 3) << " " );
and I found _1
is used to represent each input integer, but how does this _1
work? Anyone knows?
PS: This code is from the first example of BOOST. When I ran the file, I found the for_each will never terminate and it kept read numbers after each "return" click. Any idea why this happened?