Invariant Question (yes, another one)
Janice Caron
caron800 at googlemail.com
Thu Nov 15 07:09:06 PST 2007
On 11/15/07, Xinok <xnknet at gmail.com> wrote:
> Const is the read-only type, meaning that the data COULD change
> unexpectedly. However, invariant means the data is guaranteed never to
> change. You can't guarantee const data is never going to change,
I know that. You're stating the obvious.
> which
> is why it gives you an error.
I don't follow that reasoning. Please explain in more detail.
invariant(char)[] can always be implicitly cast to const(char)[] ...
and that's exactly what I'm trying to do.
More information about the Digitalmars-d
mailing list