The error messages are the result of you trying to initialize a std::vector
with 2 double
s:
std::vector x(somedouble, otherdouble);
std::vector
thinks those doubles are input iterators specifying a range it's supposed to load from.
Since nothing like that appears in the code you posted, we can only guess at the actual problem. You need to make a minimal example that exactly reproduces your problem and post the entire code in a new question.
EDIT1: Yep, there it is: response[k+1] = {pos[k].x,pos[k].y};
Since x
and y
are doubles instead of floats, you are triggering the two-iterator constructor to make a temporary vector to assign to response[k+1]
instead of the initializer-list constructor. Change the line to
response[k+1].push_back(pos[k].x);
response[k+1].push_back(pos[k].y);
or
response[k+1] = {float(pos[k].x), float(pos[k].y)};