'scope' confusion
Salih Dincer
salihdb at hotmail.com
Fri Apr 15 23:10:27 UTC 2022
On Friday, 15 April 2022 at 20:43:19 UTC, Walter Bright wrote:
> 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.
A very good explanation. Thank you very much for my own name.
SDB at 79
More information about the Digitalmars-d
mailing list