Report
6 months, 3 weeks 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...

Comment on this question

2 Answers

6 months, 3 weeks ago.

Hello Igor,

Please have a look at this reply.

6 months, 3 weeks ago.

Very nice blog! thanks for sharing.

Very nice

posted by Roshani Tripathi 25 Dec 2018

To post an answer, please log in.