3

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?

Luc Touraille
  • 79,925
  • 15
  • 92
  • 137
chila
  • 2,372
  • 1
  • 16
  • 33

1 Answers1

1

I asked the same question at http://news.gmane.org/gmane.comp.lib.boost.user and the answer from Christopher Schmidt was correct:

#include <boost/fusion/mpl.hpp>

should fix your problem"

wallyk
  • 56,922
  • 16
  • 83
  • 148
chila
  • 2,372
  • 1
  • 16
  • 33