added impelementation-candidate for magic type-erasure nested class
This commit is contained in:
parent
16c4822371
commit
fe574be197
11
Function.hpp
11
Function.hpp
@ -11,5 +11,16 @@ private:
|
|||||||
public:
|
public:
|
||||||
virtual Ret call(Args...) = 0;
|
virtual Ret call(Args...) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename Fun>
|
||||||
|
class callable : public callable_base
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
Fun _f;
|
||||||
|
public:
|
||||||
|
callable(Fun f):_f(f) {}
|
||||||
|
virtual Ret call(Args... args)
|
||||||
|
{ return _f(std::forward<Args>(args)...); }
|
||||||
|
};
|
||||||
public:
|
public:
|
||||||
};
|
};
|
Loading…
Reference in New Issue
Block a user