I have a class which will wrap a dictionary to perform some operations on it. I am trying to instantiate it like:
class DescriptorList<K, Descriptor>
{
<some code>
}
Descriptor is a class that I implemented but for some reason the compiler doesnt recognize that and thinks its a generic keyword (like ‘T’). How do I make the compiler recognize my type.
If you only want the key to be generic in your wrapping type, you don’t need a type descriptor in your class declaration for the value. You only need to specify the value type (Descriptor) when you’re declaring the Dictionary instance you’re wrapping. For example: