Qinghu Wang
Qinghu Wang

Reputation: 11

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;
}

Upvotes: 1

Views: 104

Answers (1)

user17732522
user17732522

Reputation: 76889

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.

Upvotes: 2

Related Questions