Boost logo

Boost Users :

Subject: Re: [Boost-users] [MPL][FUSION] generate fusion::map from mpl::vector
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-09-29 11:14:06


AMDG

Manuel Jung wrote:
> Well this looks nice, but it doesn't compile for me.
> I attached the compile errors output.
> Thanks!
>

The following compiles for me.

#include <boost/fusion/include/map.hpp>
#include <boost/fusion/include/mpl.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/mpl/transform.hpp>

namespace mpl = boost::mpl;
namespace fusion = boost::fusion;

namespace boost {
    template<class T>
    class promise_stream {};
}

template< typename OutSignatures >
struct filter_impl{

    typedef typename fusion::result_of::as_map<
        typename mpl::transform<
            OutSignatures,
            fusion::pair<mpl::_1, boost::promise_stream<mpl::_1> >
>::type
>::type Out_type;

};

#include <iostream>
#include <typeinfo>

int main() {
    std::cout << typeid(filter_impl<mpl::vector<int, char, double>
>::Out_type).name() << std::endl;
}

In Christ,
Steven Watanabe


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net