digitalmars.D.learn - Get current object in method
- Tino Schmedemann <Tino_member pathlink.com> Sep 23 2005
- "Unknown W. Brackets" <unknown simplemachines.org> Sep 23 2005
- Hasan Aljudy <hasan.aljudy gmail.com> Sep 24 2005
Is there a way to get a reference/pointer to the current object in a method of this object. I'm a total newbie to D so write slowly :)
Sep 23 2005
Hopefully I'm not misreading your question, but do you mean... this, by
this object?
By example:
# class Test
# {
# int foo()
# {
# return this.bar();
# }
#
# int bar()
# {
# return 42;
# }
# }
If that's not what you mean, could you please clarify?
-[Unknown]
Is there a way to get a reference/pointer to the current object in a method of
this object.
I'm a total newbie to D so write slowly :)
Sep 23 2005
Tino Schmedemann wrote:Is there a way to get a reference/pointer to the current object in a method of this object. I'm a total newbie to D so write slowly :)
this "this" is a keyword that is a "reference/pointer to the current object in a method of this object."
Sep 24 2005









"Unknown W. Brackets" <unknown simplemachines.org> 