Jan 31, 2016

Alias ugly generic type names

Though aliasing (with using keyword) generic types is not possible as of C# 6.0, sometimes you can go with inheritance:


public class MyList<T1, T2> : 
    List<Tuple<IEnumerable<HashSet<T1>>, IComparable<T2>>>
{ }

public void Meth()
{
    var x = new MyList<int, bool>();
}

No comments:

Post a Comment