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
You can use "extern" keyword: first time (assume, in header file) you can declare your variable preceding declaration with "extern" keyword. Later (in source file) you repeat declaration without "extern" and assign value to it.