V
Venkatesh Reddy
Hi all -
So, basically, I want to create a class inherited from a SortedList<T1, T2>
with the types T1, T2 fixed. But the C# compiler gives me an error when I do
this:
class C : SortedList<T1, T2>
{
}
Instead, I have to do this:
class C<T1, T2> : SortedList<T1, T2>
{
}
But then, when I use the class, I have to always declare variables with type
C<T1, T2> instead of just C.
Any thoughts? I don't want other people using this class to have to bother
with the types. Maybe I am using SortedList wrong, and there is a better way
of doing what I want?
Thanks.
-- V
So, basically, I want to create a class inherited from a SortedList<T1, T2>
with the types T1, T2 fixed. But the C# compiler gives me an error when I do
this:
class C : SortedList<T1, T2>
{
}
Instead, I have to do this:
class C<T1, T2> : SortedList<T1, T2>
{
}
But then, when I use the class, I have to always declare variables with type
C<T1, T2> instead of just C.
Any thoughts? I don't want other people using this class to have to bother
with the types. Maybe I am using SortedList wrong, and there is a better way
of doing what I want?
Thanks.
-- V