Instantiation of nested structs should be allowed outside their parent scope

Stanislav Blinov stanislav.blinov at gmail.com
Tue Nov 9 01:54:44 UTC 2021


On Tuesday, 9 November 2021 at 01:06:16 UTC, Stefan Koch wrote:

> How would you want a struct to behave when it is used outside 
> of it's context?
> Set the context pointer to null and throw upon access?

Throw? No, segfault like any other null dereference. Ain't no 
harm in that. As compared to absolutely ruining generic code for, 
frankly, no benefit, and numerous, NUMEROUS bugs and 
"workarounds" that simply don't need to exist.


More information about the Digitalmars-d mailing list