const a storage class or a type modifier?

Michel Fortin michel.fortin at michelf.com
Fri Nov 26 06:19:53 PST 2010


On 2010-11-26 09:12:53 -0500, Jens Mueller <jens.k.mueller at gmx.de> said:

> So how do you like it to be?
> void foo(const(int)*, char *, const(float)*);
> or
> void foo(const int*, char *, const float*);
> 
> I still like the fixed original one namely
> void foo(const(int)*, char *, const float*);

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*);

My opinion is that we have too much choice. When everyone can write the 
same thing differently it can easily become confusing.


-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d mailing list