DIP25 draft available for destruction

Walter Bright newshound2 at digitalmars.com
Wed Feb 6 22:09:48 PST 2013


On 2/6/2013 8:16 PM, Marco Leise wrote:
> As for the address taking, I hope it doesn't end up in being
> nannied to much by the language. Like in the case with printf,
> it could really piss people off that don't understand the
> reasoning behind it. Make the error message informative for
> that: "Potential escape of pointer to stack local" or
> similar.

I think C++ missed an opportunity with reference types. All they are in C++ are 
just another way to express a pointer. They don't really offer any semantic 
improvement - you can even have null references.

In D, we have an opportunity to define reference types as a kind of "safe" 
pointer type - where we can get much of the advantages of pointers without the 
potential for memory corruption.



More information about the Digitalmars-d mailing list