'scope' confusion

Walter Bright newshound2 at digitalmars.com
Fri Apr 15 20:43:19 UTC 2022


The trouble here is the scope array is a static array. This means the scope 
applies to the elements of the static array.

But when passing it to the function, the static array is converted to a dynamic 
array. A dynamic array is a pointer to the array's elements.

The scope protections are not transitive, so a scope dynamic array does not 
protect its elements as scope, hence the errors you're seeing.


More information about the Digitalmars-d mailing list