I have a reference to MyOjbect, but the the exact object depends on a condition. So I want to do something like this:
MyOjbect
MyObject& ref; if([co
AFAIK this can't be done with a reference. You'd have to use a pointer:
MyClass *ptr; if (condition) ptr = &object; else ptr = &other_object;
The pointer will act similar to a reference. Just don't forget to use -> for member access.
->