Tags: #output #paramaters #fix
"There are some cases where you need to return a value from a function but cannot use the return value."
https://foonathan.github.io/blog/2016/10/26/output-parameter.html
"There are some cases where you need to return a value from a function but cannot use the return value."
https://foonathan.github.io/blog/2016/10/26/output-parameter.html
foonathan.github.io
void foo(T& out) - How to fix output parameters
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…