Partial Specialization of Generics

I want to do something like this:

using StringDictionary<T> = System.Collections.Generic.SortedDictionary<System.String, T>;

How do I accomplish that If C# 2.0 doesn't syntactically support the notion, what is the next best equivalent




Answer this question

Partial Specialization of Generics

  • baga

    Is there an echo in here
  • setareh

    It looks like . Probably we should suggest to add some functionality to this forums like: if someone is editing a post and somebody else adds a post warn the person who is editing...
  • Tdar

    Not sure if I follow totally, but if you want a sorted-dictionary where the key is always a string and the value is generic, then try this:

    public class SortedStringDictionary<T> : SortedDictionary<string, T>
    {

    }

     


  • Ishfaqa

    Create a generic class that inherits SortedDictionary

    class StringDictionary<T> : SortedDictionary<string, T>

    {

    }


  • Partial Specialization of Generics