implicit or module-wide @nogc

Mike Franklin slavo5150 at yahoo.com
Wed Jun 13 07:24:36 UTC 2018


On Wednesday, 13 June 2018 at 07:19:24 UTC, Gokhhy wrote:

> Nevermind, it doesn't affect functions inside classes and 
> structs.

Yeah, that's kindof unfortunate isn't it.  Just do the same thing 
within the class/struct scope.

class C {
    @nogc:

    void nogcMethod1() {}
    void nogcMehtod2() {}
}

> I would be interested in what influenced the design decision to 
> make opting out of garbage collection so difficult.

Because D is more evolution then intelligent design, 
unfortunately.

Mike



More information about the Digitalmars-d-learn mailing list