How to return the current object

2011-09-25 Thread alex
Is there a way to return the current object in any part of the code, even from void main? (which is still a type void). I have tried the this thing but it doesn't work -- Alex Herrmann PC load letter

Re: How to return the current object

2011-09-25 Thread Ali Çehreli
On Sun, 25 Sep 2011 20:20:59 -0600, alex wrote: > Is there a way to return the current object in any part of the code, I presume you mean returning self from a member function: class C { C foo() { return this; } C bar() { return this; } } void main() {

Re: How to return the current object

2011-09-27 Thread Nick Sabalausky
"alex" wrote in message news:j5onj9$2f85$1...@digitalmars.com... > Is there a way to return the current object in any part of the code, even > from void main? (which is still a type void). I have tried the this thing > but it doesn't work Main isn't a member of any object, so there is no "this