Tuesday, 15 July 2014

c++ - Can't pass arguments to thread function -



c++ - Can't pass arguments to thread function -

okay trying create thread in c++ runs function storepose(); function takes 9 parameters doubles. every time seek create thread complains parameters. post code below. have not clue why wont work. in advanced

code:

std::thread t(storepose,x_position, y_position, z_position, azimuth, att_pitch, att_roll, yaw, cam_pitch, cam_roll); t.detach();

error given:

12 intellisense: no instance of constructor "std::thread::thread" matches argument list argument types are: (<unknown-type>, double, double, double, double, double, double, double, double, double)

edit: sorry forgot mention using visual studio 2012

microsoft visual c++ (2012) doesn't have back upwards variadic templates. have called faux variadics stamp out overloads via macros. problem there limit number of arguments can pass variadic template , default limit 5. can adjust limit defining _variadic_max larger number (e.g. limit of 10 set /d_variadic_max=10)

see this , this.

c++ multithreading visual-studio-2012

No comments:

Post a Comment