I have a function that processes a given vector, but may also create such a vector itself if it is not given.
I see two design choices for such a case, where a func
I, too, prefer the second one. While there are not much difference between the two, you are basically using the functionality of the primary method in the foo(int i)
overload and the primary overload would work perfectly without caring about existence of lack of the other one, so there is more separation of concerns in the overload version.