
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Christopher Schmidt Sent: 22 December 2009 23:24 To: boost-users@lists.boost.org Subject: Re: [Boost-users] mpl/fusion: metafunction to 'rangify'
In the meantime, can I just use the fusion::transform on the adapted struct instead of mpl::transform? What I really want is a new fusion sequence the elements of which are the result of my metafunction applied on the elements of the adapted struct. So this seemed to be a mpl::transform job.
This should work fine:
struct make_fixed_or_range { template<typename Sig> struct result;
template<typename Self,typename Arg> struct result<Self(Arg)> { typedef fixed_or_range<Arg> type; };
template<class Arg> typename result<make_fixed_or_range(Arg)>::type operator()(Arg); };
typedef boost::fusion::result_of::as_vector<boost::fusion::result_of::transform< params,make_fixed_or_range>::type>::type params_fixed_or_range;
-Christopher
It does. Of course, the return type of fusion::transform contains the compile-time information required. Thanks very much, Now I'll look at spirit (and some magic code to generate the Qi parser for this new sequence) to fill it up with values from an input stream. Thanks again, Rds,