以下代码未在Compact Framework 2(VS2008)上编译
public delegate TResult Func<out TResult>();
public delegate TResult Func<in T, out TResult>(T a);
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
我不确定代码作者想做什么,我需要知道如何解决这个问题。
广告信息:此代码来自LinqBridge的源
感谢
代码只是定义了.NET 2.0、中尚未定义的各种Func
委托
尝试去掉in
和out
修饰符,因为它们在.NET 2.0中也不受支持:
public delegate TResult Func<TResult>();
public delegate TResult Func<T, TResult>(T a);
public delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);
public delegate TResult Func<T1, T2, T3, TResult>(T1 arg1, T2 arg2, T3 arg3);
public delegate TResult Func<T1, T2, T3, T4, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);