Fwd: [fusion] Using boost::mpl::fold with a fusion sequence

Hi. When I try to compile this:
#include
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?

-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Roberto Giménez Sent: 30 December 2009 13:48 To: boost-users@lists.boost.org Subject: [Boost-users] Fwd: [fusion] Using boost::mpl::fold with a fusion sequence
Hi. When I try to compile this:
#include
#include int main(int argc, char** argv) { typedef boost::fusion::map < boost::fusion::pair
, boost::fusion::pair > FuMap; FuMap fuMap("hello", 'w');
unsigned val = boost::mpl::fold < FuMap, boost::mpl::int_<0>, boost::mpl::nextboost::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_implboost::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,

Roberto Giménez schrieb:
Hi. When I try to compile this:
#include
#include
[snip]
I get the following error:
"...boost/mpl/begin_end.hpp", line 35: Error, nofieldfnd: apply is not a member of boost::mpl::begin_implboost::fusion::fusion_sequence_tag.
Including

You're right. Now it works. Thanks!
2009/12/30 Christopher Schmidt
Roberto Giménez schrieb:
Hi. When I try to compile this:
#include
#include [snip]
I get the following error:
"...boost/mpl/begin_end.hpp", line 35: Error, nofieldfnd: apply is not a member of boost::mpl::begin_implboost::fusion::fusion_sequence_tag.
Including
should fix your problem. -Christopher
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Christopher Schmidt
-
Hicham Mouline
-
Roberto Giménez