const a storage class or a type modifier?

Jens Mueller jens.k.mueller at gmx.de
Sat Nov 27 11:37:53 PST 2010


Trass3r wrote:
> >I don't really have a preference. Note that for function
> >arguments, you can also use 'in' to mean const:
> >
> >	void foo(in int*, char *, in float*);
> 
> Isn't "in" the default (even if nothing is specified)?

I don't know. I never read this. I don't think that's the case.
For example
void foo(in int a) {
    //a = 1; // won't compile
}
Whereas
void foo(int a) {
    a = 1; // this compiles
}
compiles.
So in is definitely not the default.

Jens


More information about the Digitalmars-d mailing list