Re: Voldemort type "this" pointer

2021-04-22 Thread realhet via Digitalmars-d-learn
On Wednesday, 21 April 2021 at 15:53:59 UTC, Ali Çehreli wrote: On 4/21/21 8:37 AM, realhet wrote: On Wednesday, 21 April 2021 at 10:47:08 UTC, Mike Parker wrote: On Wednesday, 21 April 2021 at 10:00:51 UTC, realhet wrote: It has access to the context of its enclosing scope (via an added

Re: Voldemort type "this" pointer

2021-04-21 Thread Ali Çehreli via Digitalmars-d-learn
On 4/21/21 8:37 AM, realhet wrote: On Wednesday, 21 April 2021 at 10:47:08 UTC, Mike Parker wrote: On Wednesday, 21 April 2021 at 10:00:51 UTC, realhet wrote: It has access to the context of its enclosing scope (via an added hidden field). Thanks! So it is unsafe to return a non-static

Re: Voldemort type "this" pointer

2021-04-21 Thread realhet via Digitalmars-d-learn
On Wednesday, 21 April 2021 at 10:47:08 UTC, Mike Parker wrote: On Wednesday, 21 April 2021 at 10:00:51 UTC, realhet wrote: It has access to the context of its enclosing scope (via an added hidden field). Thanks! So it is unsafe to return a non-static nested struct from a function. But it

Re: Voldemort type "this" pointer

2021-04-21 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 21 April 2021 at 10:00:51 UTC, realhet wrote: My question is about what is the "this" pointer for. Is it for storing the stack frame of the function in order to be able to serve queries that can lazily use the data from the stack frame? (I guess it's something else because that

Voldemort type "this" pointer

2021-04-21 Thread realhet via Digitalmars-d-learn
Hi, I noticed that there is a hidden "this" pointer in a struct that I declare inside a body of a function. Also noticed when I use the "static" keyword, the "this" pointer disappears. My question is about what is the "this" pointer for. Is it for storing the stack frame of the function in