Completely unrelated: can anyone tell me why language authors introduce in/out/inout function parameters (see also C#).
It feels like this is some rather bad workaround for something that breaks assumptions about parameters being passed into the function.
If the allocation is owned by the calling function which uses it internally and then doesn’t return it, it can be a stack variable. Or the same allocation can be reused many times in a loop. Or an array of allocations can be made all at once with foreknowledge of the total number.
But you might be conflating that with in/out for Contra/Co-variance when specifying a generic.
They are one way to implement multiple return values. For multiple returns, tuples can be used. In fact, async methods can’t declare out params