Hi,
Can I pass the address of a copy of a local object to a pointer? Say function someFunc(), of a container class L returns a copy of a local object of type X. X is derived from the ABSTRACT class Y.
X L::someFunc()
{ X local;
// rest of code
return X;
}
How can I pass the object returned to a pointer of abstract class Y, that is, say:
L Lobject;
Y* Yptr = &(Lobject.someFunc();
If I do the above I get the compiler error:
'&': illegal operation on bound member function expression
I wonder if anyone can offer a solution. All help will be greatly appreciated.
Can I pass the address of a copy of a local object to a pointer? Say function someFunc(), of a container class L returns a copy of a local object of type X. X is derived from the ABSTRACT class Y.
X L::someFunc()
{ X local;
// rest of code
return X;
}
How can I pass the object returned to a pointer of abstract class Y, that is, say:
L Lobject;
Y* Yptr = &(Lobject.someFunc();
If I do the above I get the compiler error:
'&': illegal operation on bound member function expression
I wonder if anyone can offer a solution. All help will be greatly appreciated.