Boost BiMap Parse Template Error

117 Views Asked by At

I am getting parse template error when I add #include<boost/bimap.hpp> I want to find the key of a map from its value and hence thought of using Boost's Bimap but getting below error.

/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<(const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&, const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout2>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:375:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
                   ^
/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<=(const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&, const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout2>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:383:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
                   ^
/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<(const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&, const std::pair<F, S>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:424:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
                   ^
/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<=(const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&, const std::pair<F, S>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:432:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
                   ^
/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<(const std::pair<F, S>&, const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:473:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
                   ^
/usr/include/boost/bimap/relation/structured_pair.hpp: In function ‘bool boost::bimaps::relation::operator<=(const std::pair<F, S>&, const boost::bimaps::relation::structured_pair<FirstType, SecondType, Info, Layout1>&)’:
/usr/include/boost/bimap/relation/structured_pair.hpp:481:19: error: parse error in template argument list
     return (  ( a.first  <  b.first  ) ||
1

There are 1 best solutions below

0
sehe On

Using GCC 4.8.5:

So all in all it looks like you're doing something else wrong. What other includes are there? Check the preprocessed source if possible.