0

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  ) ||
spnsp
  • 163
  • 1
  • 8
  • Please show the minimal code to reproduce. If it's **just** the include, name compiler and versions – sehe Feb 09 '18 at 16:21
  • From what you've shown here I suspect a #define overrides the meaning of an identifier involved (e.g. like `first`) making the compiler think a template argument list is coming with the `<` – sehe Feb 09 '18 at 16:22
  • Sorry.. I have not written any code yet. If i just include the header, i am getting the error. Compiler is - gcc 4.8.5 – spnsp Feb 09 '18 at 17:09
  • Other versions (boost?) and flags? – sehe Feb 09 '18 at 17:18

1 Answers1

0

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.

sehe
  • 374,641
  • 47
  • 450
  • 633