Can we have strcu with destructor have postblit disabled if none is provided ?

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 5 15:22:01 PDT 2015


I find myself reproducing the same pattern again and again, where 
I need to disable postblit on struct that have a sdestructor.

It doesn't make any sense and it is error prone. If the struct is 
copied, then the destructor is going to run twice and free the 
same resource twice, which is dangerous and incorrect.

Most C++ compiler warn nowadays about this. I don't think we 
should allow it at all in D.


More information about the Digitalmars-d mailing list