Because it just... makes sense?
You don't want to strip non-top-level constness from a pointer/reference because that would be unsafe (potentially letting you modify a const object, which is UB).
But when creating a copy (using auto
without &
/&&
), you don't really care about the constness of the original object. If you e.g. have a function returning const T &
(or god forbid const T
), it doesn't make you any more likely to want a const copy of the return value, compared to a function returning just T
or T &
.
And as noted by @user12002570's in his answer, auto ref2 = ref; //ref2 is int&!
- the comment here is wrong, the type is deduced as just int
.