-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Hi,
In a newer version of c#, can you consider this as a new feature?
Returning multiple values from a function is really useful and would avoid either returning a class / struct or using out parameters.
The syntax could be something like:
var result = false;
var someOtherValue = "";
result, someOtherValue = SomeMethod(100, 100);
to return multiple values do something like:
public bool, string SomeMethod(int number1, int number2) {
return true, "blah blah blah";
}
which seems a lot nicer than:
public bool SomeMethod(int number1, int number2, out string returnValue) {
returnValue = "blah blah blah";
return true;
}
There are a few uservoices for this:
UPDATE: This is covered by #347 which is listed as having "Strong Interest" on the C# 7 work list :)
Reactions are currently unavailable