|
Boost : |
Subject: Re: [boost] [fusion][mpl] transform_view and as_vector compilation error
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2013-12-15 15:25:23
On 12/15/2013 05:24 PM, Agustín K-ballo Bergé wrote:
> 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;
>> };
Ok, thank you. It works. I never needed this operator, since I only used
the result_of class. I think a MPL transform would have be enough for it
to work correctly.
>>
>
> Regards,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk