Simplified Thread interface
Former-commit-id: 5cc7c51be1bf8fe8f13e3b4d25b051ff024f4ebf
This commit is contained in:
parent
3d8549740e
commit
b775542e4d
|
|
@ -40,7 +40,6 @@ class NAZARA_API NzThread : NzNonCopyable
|
||||||
};
|
};
|
||||||
|
|
||||||
NzThread() = default;
|
NzThread() = default;
|
||||||
template<typename F> NzThread(F function);
|
|
||||||
template<typename F, typename... Args> NzThread(F function, Args... args);
|
template<typename F, typename... Args> NzThread(F function, Args... args);
|
||||||
template<typename C> NzThread(void (C::*function)(), C* object);
|
template<typename C> NzThread(void (C::*function)(), C* object);
|
||||||
NzThread(NzThread&& other);
|
NzThread(NzThread&& other);
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,13 @@
|
||||||
|
|
||||||
#include <Nazara/Core/Debug.hpp>
|
#include <Nazara/Core/Debug.hpp>
|
||||||
|
|
||||||
template<typename F>
|
|
||||||
NzThread::NzThread(F function)
|
|
||||||
{
|
|
||||||
CreateImpl(new NzFunctorWithoutArgs<F>(function));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename F, typename... Args>
|
template<typename F, typename... Args>
|
||||||
NzThread::NzThread(F function, Args... 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>
|
template<typename C>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue