mercredi 5 août 2015

Can I modify function wrapper so that it uses its old value?

Can I modify function wrapper like this

std::function<int(int)> a=[](int x){return 2*x;};
a=[f=a](int x){return f(x)+1;};

so I can dynamically build more and more complex functions?

Aucun commentaire:

Enregistrer un commentaire