Michael said:
Should i write:
for(size_t i=0;i<vec.size();i++) doSumfink();
or
for(int i=0;i<vec.size();i++) doSumfink();
Neither of the above, at least as a general rule.
I'm going to guess that vec is a container and that you really want
doSumfink to operate on the items in that container. In that case, I'd
recommend something like:
std::for_each(vec.begin(), vec.end(), doSumfink);
However, I feel obliged to add that I think for_each is over-used --
I'd say the majority of times I've seen it used, something else would
have worked better. OTOH, you haven't told us enough to indicate using
anything else either.