const

Sean Kelly sean at invisibleduck.org
Fri Mar 28 10:48:12 PDT 2008


== Quote from Janice Caron (caron800 at googlemail.com)'s article
> On 28/03/2008, Oskar Linde <oskar.lindeREM at ovegmail.com> wrote:
> >  1. Plain data types don't need the storage constancy to be a part of the
> >  type.
> But they do, for the following reason. Suppose I implement a custom
> container. Then I would want
>     MyContainer!(char)
> to behave differently from
>     MyContainer!(const(char))
> The only way I can see of achieving this is if char and const(char)
> are distinct types.

Or if there are two distinct container types.  ie.

MyCotainerView!(char) and MyContainer!(char).

This doesn't require language support to achieve.


Sean



More information about the Digitalmars-d mailing list