If you wrote this method, just change the function signature to
void getBounds( float*, float*, float*, float*, float*, float* )
so you can pass nullptrs if you want to ignore the parameter. Otherwise, you can write a wrapper function.
void getBounds( float*a, float*b, float*c, float*d, float*e, float*f ) { float dummy; getBounds( a ? *a : dummy, b ? *b : dummy, c ? *c : dummy, d ? *d : dummy, e ? *e : dummy, f ? *f : dummy ); }
If your situation does not occur regularly, another way of handling this may be to record
float xmax; // in outer scope { float dummy; // in inner scope. Will be thrown away afterwards getBounds( dummy, dummy, dummy, xmax, dummy, dummy ); }
so that you do not interfere with you.
I would prefer the first option.
source share