Struct should be invalid after move

Sebastiaan Koppe mail at skoppe.eu
Wed Nov 28 09:29:42 UTC 2018


On Wednesday, 28 November 2018 at 09:17:39 UTC, sanjayss wrote:
> I have always wanted a feature in C that would let me 
> explicitly tell the compiler that a variable is no longer in 
> scope (some sort of unset of a variable). This would be useful 
> to do defensive programming against use-after-free of pointers 
> to allocated memory and such.
>
> Though it would be nice to have the compiler auto-detect these 
> kinds of things, maybe having the programmer explicitly request 
> this might be way easier to implement.

Yeah. It would be awesome if the programmer could 'taint' a 
variable as invalid. Even if that doesn't propagate in all cases.


More information about the Digitalmars-d mailing list