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 need to initliaze it. But if you would like to conditionally initialize it, you can do something like this:
MyObject& ref = (condition) ? MyObject([something]) : MyObject([something else]);