Granted, I cannot think of any reason why I would ever want to override the unary &
operator, but in https://stackoverflow.com/a/4542813/368896 the poster states, in regards to some class X
:
...unless X does something really dumb, like overloading the unary & to return this
(NOTE: I assume this comment refers to the fact of the &
operator returning this
, not the fact of overriding the &
operator itself.)
As I thought about that comment, it occurred to me that "returning this" is exactly what the &
operator does - even in cases of multiple inheritance.
Given that one might never want to override the unary &
operator, nonetheless why would it be dumb to have it return this
(if you did decide to override it)?