I have a vector containing function pointers:
vector<double (*)(vector<double>)> dY = {d2x,d2y,dx,dy}
in another function, I have a for loop iterating over this vector.
for( vector<double>::const_iterator it = dY.begin(); it != dY.end(); ++it){
vector<double> Y = {0,10,0,10};
...
}
Now I want to compute d2x(Y),d2y(Y),dx(Y) and dy(Y), but I fail to correclty cast the iterator, so that I can supply the arguments.
How can I do this?
Thanks a lot
Do you really iterate over the correct vector? The type of
itin the loop doesn’t fit thedYvector.Once you have a correct iterator, this should work: