On Thursday, 12 January 2023 at 17:46:45 UTC, seany wrote:

Please, can you explain what role "static" plays here? Thank you again

Of course, there are actually 2 paragraphs of information and examples [here](
https://dlang.org/spec/class.html#nested-context):

Non-static nested classes work by containing an extra hidden member (called the context pointer) that is the frame pointer of the enclosing function if it is nested inside a function, or the this reference of the enclosing class's instance if it is nested inside a class.

When a non-static nested class is instantiated, the context pointer is assigned before the class's constructor is called, therefore the constructor has full access to the enclosing variables. A non-static nested class can only be instantiated when the necessary context pointer information is available.

SDB@79

Reply via email to