I have some trouble about auto reference.
const int i = 1;
auto & ri1 = i;
auto & ri2 = 1; //error
Why is deduced type of ri1 const int but not ri2?
Thanks!
Since i has type const int, but 1 has type int.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With