static class vs. static struct

Piotrek via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 27 13:33:12 PST 2015


On Tuesday, 27 January 2015 at 18:24:29 UTC, Ali Çehreli wrote:
> On 01/27/2015 08:33 AM, Piotrek wrote:
>
> >> Non-static means nested.
> >
> > Hmm,this can be misleading. Nesting in structs doesn't
> introduce context
> > pointer.
>
> You must be thinking of structs nested inside user-defined 
> types. Structs that are nested inside functions do have the 
> context pointer.
>
> Ali

What you wrote about the structs is true. However I was referring 
to other thing. I just wanted to emphasize (with my poor English) 
that also classes and structs *nested in struct* doesn't contain 
the additional context pointer. As opposed to class nested in 
class.

Then I think we'd better not say that non-static means nested.

Piotrek


More information about the Digitalmars-d-learn mailing list