jeudi 20 août 2015

why auto i = same_const_variable could not deduce "const"?

const int ci = 10;
auto i = ci;  // i will be "int" instead of "const int"
i = 20;

I am wondering why auto is designed for this kind of behaviour?

why the type i is "int" instead of "const int" ?

what is the concern here?

Aucun commentaire:

Enregistrer un commentaire