const

Walter Bright newshound1 at digitalmars.com
Fri Mar 28 12:06:18 PDT 2008


Janice Caron wrote:
> Right. But that would mean that MyContainer could never behave like a
> built-in array. The ability to mimic built-in arrays with custom
> containers is highly desirable, as I'm sure you will agree. So, if I
> want MyContainer!(char) to mimic char[], and MyContainer!(const(char))
> to mimic const(char)[], then I really need to make that distinction.

Yes, that was another issue we wanted as an axiom - we could wrap any 
type with a struct and have it work like the underlying type. This axiom 
drove a lot of decisions about how things work.



More information about the Digitalmars-d mailing list