C# function with required return value

Viewed 318

Is there a way to write a function that requires that who uses it to get the return value?

For example. this will be throw an error:

public int MustUseReturnValueFN() {
   return 1;
}

private void main() {
   MustUseReturnValueFN(); // Error
   int a = MustUseReturnValueFN(); // Not Error
}
1 Answers
Related