Chris Angelico wrote:
trying to do won't work with injection. But perhaps subclassing can do what you want - instead of compiling the entire class again, create a subclass that replaces that one function.
Yes, well, that won't cut it, I'm afraid, because I specifically want that function to be able to pretend that he is living inside the already live/running older object of the old class (needs access to those variables/members).
I'm trying to see how close I can get to rapid development where you actually replace methods inside live classes during runtime.
On a related question then, if I do this:
class D { class E { void F() { } } function G() { E e = E(); return e->F; } }
int main() { D d = D(); function ref = d->G(); d = 0; gc(); // At this point, does object d still // have references? // Or is it gone because from F // we do not refrence D? return 0; }