Go, D, and the GC
Shachar Shemesh via Digitalmars-d
digitalmars-d at puremagic.com
Wed Oct 7 20:20:43 PDT 2015
On 07/10/15 12:58, Timon Gehr wrote:
>> Shachar
>
> struct S{
> @disable this();
> @disable enum init=0;
> }
>
> void main(){
> S s; // error
> auto d=S.init; // error
> }
>
An honest question. Would that also cover all cases where init is being
used implicitly by the compiler?
I will need to do some research myself, but my gut feeling is "no".
There are several cases where the compiler replaces the value with the
init value, and I doubt your horrid hack changes that.
Either way, I think you'll agree that D needs to be better in defining
what is the correct path to take on this, as, currently, nobody seems to
know for sure.
Shachar
More information about the Digitalmars-d
mailing list