/* * FunctorLazyFast.hpp * * Created on: 17 θών. 2020 γ. * Author: LeonidTitov */ #ifndef UMLIBRARY_SYSTEMIC_FUNCTORLAZYFAST_HPP_ #define UMLIBRARY_SYSTEMIC_FUNCTORLAZYFAST_HPP_ #include "IFunctor.hh" namespace systemic { namespace detail { template class FunctorLazyFast : public IFunctor { private: Object & object; Return (Object::* const pf)(Args...); public: typedef Return (Object::* Function)(Args...); FunctorLazyFast( Object & obj, Function pf ); Return operator()( Args ... args ); FunctorLazyFast(const FunctorLazyFast &) = delete; FunctorLazyFast & operator=(const FunctorLazyFast &) = delete; }; } } template inline systemic::detail::FunctorLazyFast::FunctorLazyFast( Object & obj, Return (Object::* const pf)(Args...) ) : object(obj), pf(pf) {} template inline Return systemic::detail::FunctorLazyFast::operator ()( Args ... args) { return (object.*pf)( args... ); } #endif /* UMLIBRARY_SYSTEMIC_FUNCTORLAZYFAST_HPP_ */