If you want a function that returns multiple values, you'd use a reference and assign the outputs to that. But using a reference has a few drawbacks - it is not obvious in the caller, requires default construction etc. This post will explain why you sometimes need output parameters and how to fix their problems.