【发布时间】:2014-11-13 14:06:43
【问题描述】:
我想直接进入代码;这是我的结构:
struct pnt {
mesh::Point _point;
pnt_type _type;
bool _aux;
};
enum NNSerach {A_NN = 0, B_NN, C_NN, ALL};
这是我的功能:
void typeDetection( pnt& PNT, const NNSerach NNType, const fieldclass& field )
这是我在字段类成员函数中的 for 循环。
vector< pnt > oldpnTs;
...
for(size_t iter = 0; iter < oldpnTs.size(); iter++ )
{
typeDetection(oldpnTs[iter], ALL, *this);
}
当我的向量成员只是应用函数的参数之一时,是否可以在这里使用 for_each?
编辑:我只能使用C++98 我想为 oldpnTs 向量的每个成员应用 typeDetection 函数。
【问题讨论】:
-
什么?你想使用什么 for_each? c++11基于范围的for循环?
-
编辑:我只能使用 C++98