|
Boost : |
From: Martin Apel (martin.apel_at_[hidden])
Date: 2007-08-17 02:56:17
Steven Watanabe wrote:
> AMDG
>
> Martin Apel <martin.apel <at> simpack.de> 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;
>
> typedef
> map<pair<int_<1>, int_<42> >,
> pair<int_<2>, int_<43> >,
> pair<int_<3>, int_<44> >
>
>> Map1;
>>
>
> typedef
> map<pair<int_<4>, int_<44> >,
> pair<int_<5>, int_<45> >,
> pair<int_<6>, int_<46> >
>
>> Map2;
>>
>
> typedef copy<
> joint_view<Map1,Map2>,
> inserter <map0<>, insert<_1, end<_1>, _2> >
>
>> ::type JointMap;
>>
>
> int main() {
> std::cout << at<JointMap, int_<2> >::type::value << "\n";
> }
>
> In Christ,
> Steven Watanabe
>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>
Hi Steven,
I finally found the problem. Instead of boost/mpl/insert.hpp I had
included boost/mpl/insert_range.hpp, which led to the
strange compilation errors. I had tried out a couple of variations
including using insert_range, so this is where it came from.
Thanks a lot for your help.
Best Regards,
Martin
____________
Virus checked: AVKA 17.384 from 14.08.2007
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk