A paper about traps and programming stress

Jason House jason.james.house at gmail.com
Wed Mar 17 06:05:13 PDT 2010


bearophile Wrote:

> Steven Schveighoffer:
> > I feel like we will eventually need to correctly solve these types of  
> > problems.  I think it could already be done using alias this for custom  
> > types, but the builtins would need to be treated specially.
> 
> I am ignorant about this topic, so I keep muzzle almost shut.
> See part titled "Variance" here:
> http://www.codeproject.com/KB/cs/CSharp4Features.aspx
> Is this feature added to C#4 related to this problem?
> 
> Bye,
> bearophile


That's definitely related. The new covariant ienumerable is essentially the same as head const. There is no appending or rebinding of elements, but you can still get references to mutable data out. I never remember the meanings of C++ iterator types / D range types, so I'll stop short of a range-based example.



More information about the Digitalmars-d mailing list