Simplified Thread interface

Former-commit-id: 5cc7c51be1bf8fe8f13e3b4d25b051ff024f4ebf
This commit is contained in:
Lynix 2012-12-02 23:43:08 +01:00
parent 3d8549740e
commit b775542e4d
2 changed files with 4 additions and 8 deletions

View File

@ -40,7 +40,6 @@ class NAZARA_API NzThread : NzNonCopyable
};
NzThread() = default;
template<typename F> NzThread(F function);
template<typename F, typename... Args> NzThread(F function, Args... args);
template<typename C> NzThread(void (C::*function)(), C* object);
NzThread(NzThread&& other);

View File

@ -4,16 +4,13 @@
#include <Nazara/Core/Debug.hpp>
template<typename F>
NzThread::NzThread(F function)
{
CreateImpl(new NzFunctorWithoutArgs<F>(function));
}
template<typename F, typename... Args>
NzThread::NzThread(F function, Args... args)
{
CreateImpl(new NzFunctorWithArgs<F, Args...>(function, args...));
if (sizeof...(Args) == 0)
CreateImpl(new NzFunctorWithoutArgs<F>(function));
else
CreateImpl(new NzFunctorWithArgs<F, Args...>(function, args...));
}
template<typename C>