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.