struct Functor
{
public:
template <typename... argtypes>
Functor(std::function<void()> Function)
{
this->Function = Function;
}
~Functor() {}
void operator()() const
{
OutputDebugStringA("Hello there, General Kenobi");
Function();
}
private:
std::function<void()> Function;
};
void gtk()
{
OutputDebugStringA("What is happening to meeee");
}
Functor Draw = Functor(>k);
void foo() { Draw(); }
How can I make Functor's std::function
accept Argument Types? I tried the following:
Functor(std::function<void(argtypes...)> Function)
Functor Draw = Functor<void>(>k);
But the compiler complains about 'typename not allowed'.
Aucun commentaire:
Enregistrer un commentaire