Say I have code like this:
class B {}
class D : class B {}
void MakeD(int params, D** out, int* status_out);
Today I call it like this:
B* b;
if (use_d) {
D* d;
MakeD(params, &d, &status)
b = d;
} else...
Is there a cleaner way to write this avoiding a separate 'd' object, but without losing the existing type safety (i.e. no reinterpret_cast)?