简体   繁体   中英

error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::ostream {aka std::basic_ostream<char>}’)

I am trying to build Tramonto fDFT package, but.cpp file got error like this: error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream}' and 'std::ostream {aka std::basic_ostream}') stream << x1.leftshift(stream) << " " << x2.leftshift(stream)

Here is the code:

ostream& NOXLOCA::Tramonto::PTVector::leftshift(ostream& stream) const  
{
  stream << "{ ";
  stream <<  x1.leftshift(stream) << " " << x2.leftshift(stream)
         <<  " [ " << ptp << "] ";
  stream << "}";
  return stream; 
}

ostream& operator<<(ostream& stream, const NOXLOCA::Tramonto::PTVector& v)
{
  return v.leftshift(stream);
}

void NOXLOCA::Tramonto::PTVector::print(std::ostream& stream) const
{
  stream << *this << endl;
}

You seem to be trying to build an old version of the library. According to the project's github repository this has been fixed by commenting the offending lines four years ago.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM