dimanche 30 juin 2019

Inline definition of a const reference to function

int(&foo)(int, int) = [](int a, int b) { return a + b; };

doesn't compile since a mutable reference can't be initialized with a temporary. Where do I put the const?

Aucun commentaire:

Enregistrer un commentaire