6 years, 2 months ago.

How can I use lambda functions for callbacks?

There is my code

There is my code

pcContr.addCommand('q', []() {
        printf("WORKS!");
    });


void ControllerPC::addCommand(char command, Callback<void()> cb)
{
    cbCommand[commCount] = command;
    cbArr[commCount] = cb;
    commCount++;
}

Maybe someone can advice me a better way to make this...

1 Answer

6 years, 2 months ago.

Hello Igor,

Please have a look at this reply.

Accepted Answer