Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-08-16 16:11:31


Martin Apel <martin.apel <at>> writes:
> Sorry for the long delay. I was lucky to have a bank holiday yesterday
> here in southern Germany
> I tried your minor correction. However it still gives me the same
> compile errors when instantiating "at":
> /usr/include/boost/mpl/next_prior.hpp:31: error: no type named `next' in
> `struct mpl_::void_'
> /usr/include/boost/mpl/aux_/at_impl.hpp:35: error: no type named `type'
> in `struct boost::mpl::advance<mpl_::void_, mpl_::int_<2> >'
> The line causing this looks as follows:
> std::cout << at<JointMap, int_<2> >::type::value << "\n";

Really weird. Try qualifying all the names.
I was able to compile this with 1.34.1:

#include <boost/mpl/map.hpp>
#include <boost/mpl/joint_view.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/insert.hpp>
#include <boost/mpl/end.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/copy.hpp>
#include <iostream>

using namespace boost::mpl;

map<pair<int_<1>, int_<42> >,
    pair<int_<2>, int_<43> >,
    pair<int_<3>, int_<44> >
> Map1;

map<pair<int_<4>, int_<44> >,
    pair<int_<5>, int_<45> >,
    pair<int_<6>, int_<46> >
> Map2;

typedef copy<
    inserter <map0<>, insert<_1, end<_1>, _2> >
>::type JointMap;

int main() {
    std::cout << at<JointMap, int_<2> >::type::value << "\n";

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at