Created
August 27, 2012 22:13
-
-
Save DrPizza/3492807 to your computer and use it in GitHub Desktop.
Bogus VC++ 2012 error?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is yielding warning C4100: 'data' : unreferenced formal parameter in VC++ 2012. | |
// which seems bogus. Thoughts? | |
template <typename T, typename P, typename P2> | |
HANDLE CreateThread(SECURITY_ATTRIBUTES* sa, SIZE_T stackSize, T* obj, DWORD(T::* func)(P), P2 data, const char* name, DWORD flags, DWORD* tid) | |
{ | |
typedef DWORD(T::* F)(P); | |
std::unique_ptr<utility::ThreadInfoMemberFn<T, P, F> > ti(new utility::ThreadInfoMemberFn<T, P, F>(obj, func, data, name)); | |
HANDLE rv(::CreateThread(sa, stackSize, utility::ThreadDispatchMemberFn<T, P, F>, static_cast<void*>(ti.get()), flags, tid)); | |
if(NULL != rv) { ti.release(); } | |
return rv; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment