Transience of .front in input vs. forward ranges

Mehrdad wfunction at hotmail.com
Sun Nov 4 11:59:54 PST 2012


The whole problem seems to me to be caused by one simple problem 
in D:

value vs. reference semantics

If it was clear that the output of a range has value semantics, 
then clearly, its copy would not be transient.

And if it was clear that the output has reference semantics, then 
clearly, its copy could be modified internally.



So really, the problem is not with ranges.
It's with an inherent ambiguity in D -- can you assume arrays & 
structs are values or no?


More information about the Digitalmars-d mailing list