const int vs. int const

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 15 15:09:41 PDT 2014


On Fri, Aug 15, 2014 at 09:08:08PM +0000, Jonathan M Davis via Digitalmars-d wrote:
> On Friday, 15 August 2014 at 18:47:49 UTC, Walter Bright wrote:
> >It is not ambiguous from a semantic or syntactic point of view, but
> >it appears to be ambiguous for those coming from C++. This was
> >discussed at length a few years ago, but no solution emerged that
> >didn't make things much worse.
> 
> I still think that we'd be far better off if all attributes which
> could apply to a function's return type were illegal on the left-hand
> side of the function. All allowing it on the left does is cause
> confusion and bugs. It's already best practice to put it those
> attributes on the right, because if you don't, everyone who reads the
> code ends up asking whether the attribute was supposed to apply to the
> return type, and the parens were forgotten, or whether it was supposed
> to apply to the function.

+1.


T

-- 
Be in denial for long enough, and one day you'll deny yourself of things you wish you hadn't.


More information about the Digitalmars-d mailing list