- 论坛徽章:
- 0
|
编译代码提示错误,提示max函数没有声明,但是已经#include <alogrithm>了 不理解,请高人指点。
double max_setij_so_far() const {
double max_setij = setij();
std::vector<T*> my_ori = parents();
for (size_t i = 0; i < my_ori.size(); ++i)
max_setij = max(max_setij, my_ori[i]->max_setij_so_far());
return max_setij;
}
错误提示如下
error: ‘max’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
max_setij = max(max_dij, my_parents[i]->max_dij_so_far());
/usr/include/c++/4.8.3/bits/stl_algobase.h:260:5: note: ‘template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’ declared here, later in the translation unit
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
##################
默认的stl_algobase.h 模版我没有修改过 但似乎程序调用系统stl里的max不认识 正常应该可以直接去调用 max(const _Tp& __a, const _Tp& __b)阿,请指点
编译器是gcc 4.8.3
是不是my_ori[i]->max_setij_so_far() 需要重新定义一个量呢
|
|