【发布时间】:2020-12-17 01:28:19
【问题描述】:
我正在尝试使用 gcc 8.2.1 在 RHEL8 中构建以下内容。这以前使用 gcc 4.8.5 与 RHEL7 一起工作。
#include <vector>
#include <algorithm>
#include <complex>
vector<complex<float> > x, y;
transform(x.begin(), x.end(), y.begin(), conj<float>);
我得到一个错误 no matching function for call to the above line and points to close ')'
如果我尝试使用其他复杂函数代替conj,即arg、norm,则会出现同样的错误。
其他使用转换的complex<float> 操作确实有效,例如
transform(x.begin(), x.end(), y.begin(), bind2nd(minus<complex<float> >(), someComplexFloat));
其中someComplexFloat 的类型为complex<float> someComplexFloat;
有什么建议吗?
【问题讨论】:
标签: c++ algorithm vector complex-numbers