I understand that X & const x is redundant. It is not ok! But I want to know what is the difference between X const &x and X & const x?
Is the first expression saying that x is a reference to a constant class X ?
I understand that X & const x is redundant. It is not ok! But
Share
Read it from right to left :
X& const x– x is a constant reference to object of type X which doesn’t make sense, references are constant by definition.X const& x– x is a reference to constant of type X.