Given a condition, I want to select with if-else a reference to some object.
How I am currently doing it:
A *tmpPtr;
if(testCondition)
tmpPtr = &Manager.FirstObject;
else
tmpPtr = &Manager.SecondObject;
A &objectRef = *tmpPtr;
Is there more straight forward way to do this, without using temporary pointer in C++14?