Hello, I have a function whose signature
std :: string f (double x, double param1, double param2, double param3);
I would like to call it the value of std :: vector x for the parameter x, using something like std :: transform for the specific value of param1, param2 and param3.
This will be the equivalent:
double param1(1.); double param2(1.1); double param3(1.2); std::vector<std::string> results(); for (std::vector<double>::const_iterator it = xvalues.begin() ; it != xvalues.end() ; ++xvalues) { results.push_back(f(*it, param1, param2, param3); }
How can this be done more elegantly?
Regards Tony
c ++
Bluetrin
source share