A
Alex Shirshov
Hi all!
How can i specify, that the generic class have the constructor?
With c# it's a new constraint.
For instance, i write
Ok. Next try
Now i have two error message!
Can anyone help?
P.S. My versions is VS.NET Whidbey 8.0.30703.4. and the .NET Framework
1.2.30703
How can i specify, that the generic class have the constructor?
With c# it's a new constraint.
For instance, i write
Code:
Class cls1(Of T)
Public Sub some()
Dim tt As New T() ' here is an error: 'New' cannot be used on a
type parameter not declared 'As New()'.
End Sub
End Class
Ok. Next try
Code:
Class cls1(Of T as New()) ' another error: Keyword does not name a type.
Public Sub some()
Dim tt As New T() 'previos error still here
End Sub
End Class
Can anyone help?
P.S. My versions is VS.NET Whidbey 8.0.30703.4. and the .NET Framework
1.2.30703