私はout
というパラメータを持つメソッドを持っていますが、Action
またはFunc
(または他の種類のデリゲート)を指しています。Outパラメータを指定してAction <>またはFunc <>を使用できますか?
これは正常に動作します:
static void Func(int a, int b) { }
Action<int,int> action = Func;
は、しかし、これは
static void OutFunc(out int a, out int b) { a = b = 0; }
Action<out int, out int> action = OutFunc; // loads of compile errors
これはおそらく重複していないが、 'outパラメータ' を検索すると、特に実りではありません。
[outパラメータとのFunc]の可能複製(http://stackoverflow.com/questions/1283127/funct-with -out-parameter) –
nawfal