const, final, scope function parameters

gareis dhasenan at gmail.com
Sun May 27 17:23:14 PDT 2007


Johan Granberg palsat
> Rioshin an'Harthen wrote:
> > (Basically, in and no specifier swap places compared to Walter's
> > suggestion.)
> I like this one, basically it's safe by default and saves typing in the most
> common case, it would also avoid the problem I see in c++ sometimes, that
> people don't write const because it's more typing. Walter please
> reconsider, const by default will be worth any initial hassle.

I agree -- as long as there's good documentation on the meaning of each, the
worst I have to deal with is an occasional compiler warning and a quick look at
the docs. It also makes everything very consistent in that no changes get
propagated unless I specify that they should be.

I was one of the people getting confused, and that was mostly over the
definitions of scope, const, and final. Once I have a compiler yelling at me, I
can either find out with a quick test or, if the compiler warnings are good,
just change the attributes as the warning says I should. Or I could just, y'know,
read the documentation.



More information about the Digitalmars-d mailing list