vendredi 26 août 2016

What type determined by auto for lambdas in C++11? [duplicate]

This question already has an answer here:

It is common knowledge, that auto determines a type of expression.

For example:

const int x = 10;
auto y = x; // y - const int

And what type will have variable x in the next code:

auto x = [](int a, int b){ return a + b; };

// x -?

Thank you

Aucun commentaire:

Enregistrer un commentaire