Boost logo

Boost :

Subject: [boost] [fusion][mpl] transform_view and as_vector compilation error
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2013-12-15 10:17:00


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?

I am using boost 1.54.

#include <boost/fusion/include/vector.hpp>
#include <boost/fusion/include/as_vector.hpp>
#include <boost/fusion/include/transform_view.hpp>

struct t1 { struct result_type1 {}; };
struct t2 { struct result_type1 {}; };

struct my_transform
{
    template< class > struct result;

    template< class F , class T >
    struct result< F( T ) >
    {
        typedef typename T::result_type1 type;
    };
};

int main( int argc , char *argv[] )
{
    namespace fusion = boost::fusion;
    typedef fusion::vector< t1 , t2 > vector_type;
    typedef fusion::transform_view<
        vector_type , my_transform > transform_type;
    typedef fusion::result_of::as_vector<
        transform_type >::type transformed_vector_type;

    return 0;
}


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