Files
NazaraEngine/include/Nazara/Core/Functor.inl
Lynix 15afde86c8 Rewritted ResourceLoader and moved it to core
Added creation constructor to NzImage
Added member function functor
Added option to build Nazara as one library (instead of many)
Fixed some 2011 copyrights
Made use of "using def = T" C++11 feature instead of some illigible
typedefs
Removed unused premake file
2012-08-18 01:46:01 +02:00

43 lines
829 B
C++

// Copyright (C) 2012 Jérôme Leclercq
// This file is part of the "Nazara Engine - Core module"
// For conditions of distribution and use, see copyright notice in Config.hpp
template<typename F>
NzFunctorWithoutArgs<F>::NzFunctorWithoutArgs(F func) :
m_func(func)
{
}
template<typename F>
void NzFunctorWithoutArgs<F>::Run()
{
m_func();
}
template<typename F, typename... Args>
NzFunctorWithArgs<F, Args...>::NzFunctorWithArgs(F func, Args&... args) :
m_func(func),
m_args(args...)
{
}
template<typename F, typename... Args>
void NzFunctorWithArgs<F, Args...>::Run()
{
NzUnpackTuple(m_func, m_args);
}
template<typename C>
NzMemberWithoutArgs<C>::NzMemberWithoutArgs(void (C::*func)(), C* object) :
m_func(func),
m_object(object)
{
}
template<typename C>
void NzMemberWithoutArgs<C>::Run()
{
(m_object->*m_func)();
}