I would like to exclude some types for being used in a generic class. I know how to make constrains in order to make sure a generic type is some kind of (interface) type. But I can't seem to figure out how to exclude (multiple) types.
For instance: I want a generic class to exclude ints and uints (but don't exclude DateTime for instance, so not all Primitives may be excluded).
I can't do something like this:
public class SomeWhereTest2<T> where T : !System.Int32
{
}
Can someone help me out how to exclude multiple types at once?
I made a special class that acts like a dictionary and is also a FiFo collection with an index, where 0 is the most recent value, 1 the previous etc. (public class FiFoDictionary<K, V>: IDictionary<K, V>
, which uses OrderedDictionary
as the internal dict.)
But since the index is given via an int
, this gives issues when the key of the dictionary is an int
. Because then you get the value linked to the key, instead of the index. Or is there any way to force the use of the index instead of the key for an OrderedDictionary
?