Hi Folks
Can anyone explain the output of this program...
#include <iostream>
#include
#include
#include
#include
#include
#include
int f( int i ) { return i * 2; }
int main( )
{
using boost::adaptors::reversed;
using boost::adaptors::transformed;
using boost::counting_range;
using boost::copy;
using boost::phoenix::arg_names::_1;
copy( counting_range( 1, 5 ) | reversed | transformed( f ),
std::ostream_iterator<int>( std::cout, " " ) );
std::cout << std::endl;
copy( counting_range( 1, 5 ) | reversed | transformed( bind( f, _1 ) ),
std::ostream_iterator<int>( std::cout, " " ) );
std::cout << std::endl;
}
Which is...
8 6 4 2
1768406272 1768406272 1768406272 1768406272
I'm using Gcc 4.6.2 & Boost 1.53
Thx All.