Hi All
I tried to use BOOST_FOREACH with bimap but it doesn't compile.
What is wrong in using it the way is displayed below?
Reading the specs it should be able to work since bimap provide .begin() and
.end() methods.
Thanks
CS
typedef boost::bimap BMap;
typedef boost::bimap::value_type BMapVal;
typedef boost::bimap::const_iterator BMapKIt;
BMap myBimap;
myBimap.insert( BMapVal( 10, "hi") );
myBimap.insert( BMapVal( 20, "hihihi") );
BOOST_FOREACH( BMapKIt it, myBimap) // this line doesnt' compile:
{
std::cout << "LEFT: " << it->left
<< " RIGHT: " << it->right << std::endl;
}
TestBoost_Nov26.h:68: error: conversion from
‘boost::bimaps::relation::mutant_relation,
boost::bimaps::tags::tagged,
boost::bimaps::relation::member_at::right>, mpl_::na, false>’ to non-scalar
type
‘boost::bimaps::detail::set_view_iterator,
boost::bimaps::tags::tagged,
boost::bimaps::relation::member_at::right>, mpl_::na, true>,
std::allocator,
boost::bimaps::tags::tagged,
boost::bimaps::relation::member_at::right>, mpl_::na, true> > > > > >’
requested