Boost logo

Boost Users :

Subject: Re: [Boost-users] Fwd: [fusion] Using boost::mpl::fold with a fusion sequence
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-12-30 10:39:55


> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Roberto Giménez
> Sent: 30 December 2009 13:48
> To: boost-users_at_[hidden]
> Subject: [Boost-users] Fwd: [fusion] Using boost::mpl::fold with a fusion
> sequence
>
> Hi. When I try to compile this:
>
> #include <boost/fusion/container/map.hpp>
> #include <boost/mpl/fold.hpp>
>
> int main(int argc, char** argv)
> {
>    typedef boost::fusion::map
>    <
>        boost::fusion::pair<int, const char*>,
>        boost::fusion::pair<long, char>
>    > FuMap;
>
>    FuMap fuMap("hello", 'w');
>
>    unsigned val = boost::mpl::fold
>    <
>        FuMap, boost::mpl::int_<0>, boost::mpl::next<boost::mpl::_1>
>    >::type::value;
> }
>
> I get the following error:
>
> "...boost/mpl/begin_end.hpp", line 35: Error, nofieldfnd:
> apply is not a member of
> boost::mpl::begin_impl<boost::fusion::fusion_sequence_tag>.
>
>
> >From the fusion documentation: "Fusion provides full round compatibility
> with MPL. Fusion sequences are fully conforming MPL sequences and MPL
> sequences are fully compatible with Fusion. You can work with Fusion
> sequences on MPL if you wish to work solely on types."
>
> When I pass a boost::mpl::map it works.
>
> Any clues?

I haven't properly looked at your code but I had a similar error before, and
a fix was committed to boost trunk fusion 2/3 weeks ago I think.

I was playing with mpl::vector though and the fix worked for me,

Rds,


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