On 15/12/2013 12:17 p.m., Karsten Ahnert wrote:
Hi,
we have a problem in our code base. I extracted a minimal example, see below. The code works with g++ version up to 4.8.1 and C++11 but fails to compile with gcc-4.8.1 and clang3.2 and newer. Any ideas what goes wrong here? Should I further dig into the problem?
Newer compiler versions that support N3276 decltype do not use the result_of protocol anymore, instead boost::result_of uses decltype directly. For that to work you need an operator(), which was always a requirement for transform_view and other functions expecting a function object.
struct my_transform { template< class > struct result;
template< class F , class T > struct result< F( T ) > { typedef typename T::result_type1 type; };
template <typename T> typename T::result_type1 operator()(T) const;
};
Regards, -- Agustín K-ballo Bergé.- http://talesofcpp.fusionfenix.com