Nested sibling classes
Salih Dincer
salihdb at hotmail.com
Thu Jan 12 17:53:22 UTC 2023
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 at 79
More information about the Digitalmars-d-learn
mailing list