Boost logo

Boost :

Subject: Re: [boost] [fusion][mpl] transform_view and as_vector compilation error
From: Agustín K-ballo Bergé (kaballo86_at_[hidden])
Date: 2013-12-15 11:24:07


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

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk