public static void ArrayValOp <TLeft, TRight, TResult>(TLeft[] leftArray, TRight[] rightArray, TResult[] result, ValOperation <TLeft, TRight, TResult> operation) { if (leftArray == null) { throw new ArgumentNullException("leftArray"); } if (rightArray == null) { throw new ArgumentNullException("rightArray"); } if (result == null) { throw new ArgumentNullException("result"); } if (leftArray.Length != rightArray.Length || rightArray.Length != result.Length) { throw new ArgumentException("The Arrays Passed must equal in size."); } for (int pos = 0; pos < result.Length; ++pos) { result[pos] = operation(leftArray[pos], rightArray[pos]); } }
public static TResult[] ArrayValOp <TLeft, TRight, TResult>(TLeft[] leftArray, TRight[] rightArray, ValOperation <TLeft, TRight, TResult> operation) { TResult[] result = new TResult[leftArray.Length]; ArrayValOp <TLeft, TRight, TResult>(leftArray, rightArray, result, operation); return(result); }