From fe574be1978da498e4e4d3edd543b227fa4da463 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjist=C3=B3f?= Date: Sun, 27 Nov 2016 14:02:28 +0100 Subject: [PATCH] added impelementation-candidate for magic type-erasure nested class --- Function.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Function.hpp b/Function.hpp index 5fc6299..c670842 100644 --- a/Function.hpp +++ b/Function.hpp @@ -11,5 +11,16 @@ private: public: virtual Ret call(Args...) = 0; }; + + template + class callable : public callable_base + { + private: + Fun _f; + public: + callable(Fun f):_f(f) {} + virtual Ret call(Args... args) + { return _f(std::forward(args)...); } + }; public: }; \ No newline at end of file