Simen kjaeraas <simen.kja...@gmail.com> wrote:
Steven Schveighoffer <schvei...@yahoo.com> wrote:
Note also that the optimization you stated is not possible, even
without casting away const, but would be possible on an immutable
class. But the fact that the compiler cannot peek into the
implementation of the opAssign means it's forced to make no assumptions
about the result of opAssign
You're right, I was thinking of immutable.
This said, one of the reasons casting away const is undefined, is because
the underlying type may be immutable.
--
Simen