vendredi 1 décembre 2017

Map with functions JavaScript style in C++

I'm a C++ programar with some experience with JavaScript. I would like to do in C++11 something similar to this code:

map = {
    "text1": function() { /*function1 code*/ },
    // ..
    "textn": function() { /*function1 code*/ }
 }

I'm aware they have added lambdas in C++11, but I'm not sure how to use them from my specific purpose.

Aucun commentaire:

Enregistrer un commentaire