-----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 22:50 To: boost-users@lists.boost.org Subject: Re: [Boost-users] mpl/fusion: metafunction to 'rangify'
Hicham Mouline schrieb:
I am making small progress in my attempt to generate a new mpl sequence that I will use to read from a stream.
The following code fails to compile: [snip]
You should work with a copy of fusion's trunk. See
http://thread.gmane.org/gmane.comp.lib.boost.user/53893/
for more information. Exactly what I just discovered. I copied the fix in fusion/adapted/struct/adapt_struct.hpp The is_sequence works but as you say below, mpl::transform doesn't.
Unfortunately there is another problem. mpl::transform internally instantiates mpl::clear. Fusion's implementation of mpl::clear only works for the built-in container. I think fusion's mpl::clear should rather forward to fusion::clear and fusion::clear should return a simple, empty container that models the same category as the sequence to be cleared. At the moment, fusion::clear returns fusion::vector0<> in any case.
-Christopher Stjepan Rajko had a similar problem back in Feb09 and seems to have solved it, but I don't understand. He adds a bit of code in (see pastebin) http://lists.boost.org/boost-users/2009/02/45051.php
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. Rds,