I have these overloads:
std::vector<double> ode_solve2(std::function<double(double, double, double)> f, double x0, double y0, double dydx0, double x_start, double x_end, double h = 0.1);
std::vector<double> ode_solve2(std::function<double(double, double, double)> f, double x0, double y0, double x1, double y1, double x_start, double x_end, double h = 0.1);
But when I make this call:
double h = 0.001;
double x0 = 0.0;
double y0 = 1.0;
double dydx0 = 0.0;
double start = 0.0;
double end = 10.0;
vector<double> curve = ode_solve2([] (double x, double y, double dydx){
(void) x;
return 4*dydx - 4*y;
}, x0, y0, dydx0, start, end, h);
The compiler says this is ambiguous, and both overloads are candidates for the call. My question is, if the first overload takes 7 arguments and the second takes 8 arguments and my call clearly has 7 arguments, how is this ambiguous? I don’t know too much about C++ so I apologise if I’m just missing something obvious.