Hi All I have a suspicion this is all ancient history now, but I was surprised this code worked. #include <iostream> #include <vector> #include <boost/range/adaptor/transformed.hpp> struct TimesTwo { // using result_type = int; int operator( )( int i ) const { return i * 2; } }; int main( ) { using namespace std; using namespace boost::adaptors; vector<int> v { 0, 1, 2, 3, 4, 5 }; for( int i : v | transformed( TimesTwo( ) ) ) { cout << i << " "; } cout << endl; } Due to result_type being commented out. Am I right in thinking this is what BOOST_RESULT_OF_USE_DECLTYPE was all about, and everything now just works because modern compilers are implemtenting decltype now? Kind Regards Rob.
Robert Jones via Boost-users wrote:
Am I right in thinking this is what BOOST_RESULT_OF_USE_DECLTYPE was all about, and everything now just works because modern compilers are implemtenting decltype now?
Yes. If you do #define BOOST_RESULT_OF_USE_TR1 the code should fail to compile. Regards, Michel
participants (2)
-
Michel Morin
-
Robert Jones