Range question

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Feb 17 21:51:38 PST 2012


On Sat, Feb 18, 2012 at 05:19:52AM +0200, Mantis wrote:
> 18.02.2012 2:50, H. S. Teoh пишет:
> >...
> You cannot have ref local variable, so e is a copy in any case. It
> may be a class reference or a pointer, so calling potentially
> non-const methods is probably not safe here, but assignment
> shouldn't give you problems.

But that's the problem, if e is a dynamic array, then it can potentially
be modified through the original reference after being assigned.

Ideally, I'd need e to be a reference to an immutable type. But that
requires a way of converting an arbitrary type to its immutable form,
which I don't know how to do in a generic way.


T

-- 
Let's eat some disquits while we format the biskettes.


More information about the Digitalmars-d-learn mailing list