Specifying @nogc on structs seems to have no effect

ag0aep6g anonymous at example.com
Tue Sep 19 13:55:06 UTC 2017

On 09/19/2017 03:46 PM, Craig Black wrote:
> struct MyStruct
> {
> @nogc:
> public:
>    Foo foo; // This does not produce an error, but it still requires a 
> GC scan

@nogc is about GC allocations. `Foo foo;` doesn't cause a GC allocation.

@nogc doesn't control what memory is scanned by the GC.

More information about the Digitalmars-d mailing list