Levi,
One other thing, you can always declare a type alias with the using
statement, and then use that. At the top of your file, you can do:
using MyGenericB = B<A<int>, int>;
Then, in your code, you can do:
MyGenericB var = new MyGenericB();
And it will compile fine.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Levi" <pi*******@bellsouth.net> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
class A<Ta>
{
public A() { }
}
class B<TA, Ta>
where TA : A<Ta>
{
public B() { }
}
class Program
{
static void Main(string[] args)
{
B<A<int>, int> var = new B<A<int>, int>();
//how I'd like to do it
//B<A<int> > = new B<A<int> >();
}
}
Is there some combination of syntax that'll let me declare a variable
of type B as I'd like to do it? It's a bit clunky having to say that I
want int twice.