struct task
{
task(void (*f)(void))
{
f_ = f;
}
void operator()()
{
(f_)();
}
protected:
void (*f_)(void);
};
void setup()
{
Serial.begin(115200);
auto hw = []() -> void
{
Serial.println("Hello world!");
};
task t(hw);
t();
}
void loop()
{
}