I have seen the following code (in cppreference.com)
struct A { double x; };
const A* a;
decltype(a->x) y; // type of y is double (declared type)
decltype((a->x)) z = y; // type of z is const double& (lvalue expression)
Can someone explain how it turns out that z
is const double&
?
Thanks
Aucun commentaire:
Enregistrer un commentaire