30 EYLÜL 2008, Salı
Gelecekteki bir sürüm olacak .C NET destek dizilerini#?
.Net 3.5 dizilerini desteklemiyor. Çok kötü, Ama emin gelecekteki sürümü olup olmadığını .net dizilerini destek olacak?
CEVAP
30 EYLÜL 2008, Salı
#region tuples
public class Tuple<T>
{
public Tuple(T first)
{
First = first;
}
public T First { get; set; }
}
public class Tuple<T, T2> : Tuple<T>
{
public Tuple(T first, T2 second)
: base(first)
{
Second = second;
}
public T2 Second { get; set; }
}
public class Tuple<T, T2, T3> : Tuple<T, T2>
{
public Tuple(T first, T2 second, T3 third)
: base(first, second)
{
Third = third;
}
public T3 Third { get; set; }
}
public class Tuple<T, T2, T3, T4> : Tuple<T, T2, T3>
{
public Tuple(T first, T2 second, T3 third, T4 fourth)
: base(first, second, third)
{
Fourth = fourth;
}
public T4 Fourth { get; set; }
}
#endregion
Ve tanımlamalar da güzelleştirmek için:
public static class Tuple
{
//Allows Tuple.New(1, "2") instead of new Tuple<int, string>(1, "2")
public static Tuple<T1, T2> New<T1, T2>(T1 t1, T2 t2)
{
return new Tuple<T1, T2>(t1, t2);
}
//etc...
}
Bunu Paylaş:
En iyi şekilde yapmak için Kontrol etm...
Yükleme Visual Studio VS2008 sorunlara...
Şu anda destek'In 'izin java...
Neredeyse gerçek zamanlı olarak Androi...
's ana şube'dosyanın sürüm n...