const

Jason House jason.james.house at gmail.com
Fri Mar 28 16:35:43 PDT 2008


Walter Bright wrote:

> 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.

A page online about how wrapping types in structs drove the design would be
nice to see.



More information about the Digitalmars-d mailing list