samedi 26 mars 2016

why decltype(x) gives Type but decltype((x)) gives Type&?

Its sort of interesting, when I was reading and practicing decltype() feature of modern c++ ,I have been hooked into the above question, while I put decltype(x) which 'x' is an int type it shows type as 'int' but when i wrap it into a parenthesis like decltype((X)) it says type as int&.Can anyone tell what makes the decltype() to do so? is this a standard convention or undefined behavior that deals with the compiler?

Aucun commentaire:

Enregistrer un commentaire