logoalt Hacker News

jayd16 • yesterday at 10:40 PM • 1 reply • view on HN

`out` params in C# are params that must be set within the function. They are way to implement multiple return values and tell the caller "this is written to, not read from."

But you might be conflating that with in/out for Contra/Co-variance when specifying a generic.


Replies

metaltyphoon • today at 12:54 AM

> They are way to implement multiple return values

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