I created a member function that returning reference to object.
I can do it like:
class Foo {
Foo &ref(){
return *this;
}
}
ref
returning object by look up this
pointer.
Is there any way else to return object without using this
?
EXPLAIN the reason:
The reason I don't want to use this
is: the pointer occupy 4B in stack whereas the reference share the same memory