我有一段代码在 a 上运行,std::vector<double> cats
并且正在执行以下操作:
std::find_if(cats.begin(), cats.end(), std::isnan<double>);
这在 4.3 之前的 gcc 下编译,但不再使用 gcc 4.7.2 编译。我收到这样的错误:
error: no matching function for call to 'find_if(std::vector<double>::iterator, std::vector<double::iterator, <unresolved overloaded function type>)'
我怎样才能让它在较新的 gcc 下编译?而且最好也在旧的gcc下?当然,无需摆脱 stl 并手动编写循环。如果两者都做不到,那么新的 gcc 就足够了,我会将两个实现都留在那里,并带有#define
.