简体   繁体   English

错误:'operator<<' 不匹配(操作数类型为'std::ostream {aka std::basic_ostream<char> }' 和 'std::ostream {aka std::basic_ostream<char> }')</char></char>

[英]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)我正在尝试构建 Tramonto fDFT package,但是.cpp 文件出现如下错误:错误:'operator<<' 不匹配(操作数类型为'std::ostream {aka std::basic_ostream}' 和'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.根据项目的 github 存储库,这已在四年前通过评论违规行得到修复

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:“operator&lt;&lt;”不匹配(操作数类型为“std::ostream {aka std::basic_ostream”<char> }&#39; 和 &#39;void&#39;) - error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘void’) 错误:'operator&lt;&lt;' 不匹配(操作数类型是 'std::ostream' {aka 'std::basic_ostream<char> '}</char> - error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} 错误:'operator&lt;&lt;' 不匹配(操作数类型是 'std::ostream {aka std::basic_ostream<char> }'和'列表')</char> - error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'List') 'operator&lt;&lt;' 不匹配(操作数类型是 'std::ostream {aka std::basic_ostream<char> }' 和 '分数')</char> - No match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'Fraction') 与&#39;operator &lt;&lt;&#39;不匹配(操作数类型为&#39;std :: ostream {aka std :: basic_ostream <char> }” - no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' 错误:'operator&lt;&lt;' 不匹配(操作数类型是 'std::ostream' {aka 'std::basic_ostream<char> '} 和 'std::_List_iterator<int> ')</int></char> - error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::_List_iterator<int>’) 如何修复错误:'operator&lt;&lt;' 不匹配(操作数类型为 'std::ostream {aka std::basic_ostream<char> }' 和 'void')同时使用字符串和堆栈</char> - How to fix error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'void') while using strings and stack \\ main.cpp | 103 |错误:“ operator &lt;&lt;”不匹配(操作数类型为“ std :: ostream {aka std :: basic_ostream <char> }”和“人”) - \main.cpp|103|error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'Person') 'operator&lt;&lt;' 不匹配(操作数类型为 'std::ostream' {aka 'std::basic_ostream<char> '} 和 'const std::type_index')</char> - No match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘const std::type_index’) 无法绑定&#39;std :: ostream {aka std :: basic_ostream <char> }&#39;左值成&#39;std :: basic_ostream <char> &amp;&amp;” - cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM