Another prayer for invariant strngs

Robert Fraser fraserofthenight at gmail.com
Fri Jul 13 12:18:25 PDT 2007


Oh, sorry, guess I was quite wrong. So does this mean I don't need to be making defensive copies of every string?

torhu Wrote:

> Christian Kamm wrote:
> >> The problem is
> >> that it is invariant(char)[] instead of invariant(char[])
> > 
> > I was under the impression that invariant(char)[] was the same type as
> > invariant(char[]) as invariant/const never apply to the declaration itself?
> > 
> > So
> > invariant(int) == int,
> > invariant(int*) == invariant(int)*
> > invariant(int**) == invariant(int*)* != invariant(int)**
> > 
> > Or is that incorrect?
> 
> That's my understanding too, but I'm a bit confused by that fact that 
> Walter's examples uses both variants.




More information about the Digitalmars-d mailing list