I have a function called workForThread, that takes two arguments, and returns void. I would like to thread this function using something like:
thread(workForThread,a,b);
Where a
and b
are of the appropriate types. The above code does not compile, giving a "too many arguments for call" error ("error C2197: 'void (__cdecl *)(char *)' : too many arguments for call")
How can I resolve this?
Note: I have looked at these two questions, but the resolutions that work there do not seem to work for me. Additionally, I have a feeling there is a way to do it built into c++11, and that is what I am looking for.