代码无法在 Compact Framework 上编译
code doesn't compile at Compact Framework
以下代码无法在 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 的来源
谢谢
代码只是定义了各种 Func
尚未在 .NET 2.0 中定义的委托,
尝试删除 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);
以下代码无法在 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 的来源
谢谢
代码只是定义了各种 Func
尚未在 .NET 2.0 中定义的委托,
尝试删除 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);