Thread overview | ||||||
---|---|---|---|---|---|---|
|
June 28, 2004 this-pointer | ||||
---|---|---|---|---|
| ||||
Does D's keyword "this" exactly 'behave' the same as it does in C++ (from a programmer's and not internal perspective)? Does it always hold the address of a class'es instance? Rephrased: Is the statement "this()" different from statement "this"? Or is "this" an implicit constructor call? I'm Asking because some compiler output is confusing me. F. Müller |
June 28, 2004 Re: this-pointer | ||||
---|---|---|---|---|
| ||||
Posted in reply to F. Müller | F. Müller wrote: > Rephrased: Is the statement "this()" different from statement "this"? Or is > "this" an implicit constructor call? They are different. "this()" is a constructor call, and "this" is a referance to the active instance (as in C++). > I'm Asking because some compiler output is confusing me. What is the output? Maybe someone here will be able to explain it for you. -Chris S. -Invironz |
June 28, 2004 Re: this-pointer | ||||
---|---|---|---|---|
| ||||
Posted in reply to F. Müller | On Mon, 28 Jun 2004 06:24:54 +0000 (UTC), F. Müller <F._member@pathlink.com> wrote: > > Does D's keyword "this" exactly 'behave' the same as it does in C++ (from a > programmer's and not internal perspective)? Does it always hold the address of a > class'es instance? Yes. > Rephrased: Is the statement "this()" different from statement "this"? Yes, the former is a constructor call, the latter a reference to the class. > Or is > "this" an implicit constructor call? No. > I'm Asking because some compiler output is confusing me. Post it here. :) Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
June 28, 2004 Re: this-pointer | ||||
---|---|---|---|---|
| ||||
Posted in reply to C. Sauls | On Mon, 28 Jun 2004 03:30:48 -0500, C. Sauls <ibisbasenji@yahoo.com> wrote: > F. Müller wrote: >> Rephrased: Is the statement "this()" different from statement "this"? Or is >> "this" an implicit constructor call? > > They are different. "this()" is a constructor call, and "this" is a referance to the active instance (as in C++). > >> I'm Asking because some compiler output is confusing me. > > What is the output? Maybe someone here will be able to explain it for you. Doh! I should read em all before posting... Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/ |
Copyright © 1999-2021 by the D Language Foundation