On Tuesday, 19 September 2017 at 13:13:48 UTC, Craig Black wrote:
@nogc struct Array(T)
{
  ...
}

class GarbageCollectedClass
{
}

void main()
{
  Array!int intArray; // fine
Array!GarbageCollectedClass classArray; // Error: struct Array is @nogc

}

If you want to enforce that behaviour I guess you can use reflection to check if T has attribute @nogc.

Andrea

Reply via email to