new DIP38: Safe references and rvalue references without runtime checks.

Jonathan M Davis jmdavisProg at gmx.com
Tue May 7 12:20:43 PDT 2013


On Monday, May 06, 2013 23:28:40 Timothee Cour wrote:
> Ok, I have updated and simplified the DIP38, please take a look. In
> the proposed 'manual' scheme A, the user annotates each ref argument of a
> ref-return function with either inref or outref (let's postpone the
> discussion of what exactly those keywords should be and focus on the
> logic instead; see bottom of email for a possibility). In proposed
> scheme B, the inref/outref are instead
> automatically infered. Let's focus on scheme A to avoid doing
> interprocedural analysis.

I confess that my gut reaction to all of this is that it's just plain simpler 
to do the runtime check. It won't be needed often and is trivial to disable if 
you don't want it. And it requires no annotations whatsoever. We're already 
seriously pushing it with the sheer number of annotations that we have, so I'm 
very much inclined to argue against adding new ones if we don't really need 
them.

- Jonathan M Davis


More information about the Digitalmars-d mailing list