Thanks Ken. I also found this article about generic collections.
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
In this article they say that you will be able to use generics on methods
with the following syntax;
Public Sub Swap(Of MyType) (ByRef item1 As MyType, _
ByRef item2 As MyType)
Dim temp As MyType
temp = item1
item1 = item2
item2 = temp
End Sub
Do you know if this will be able to be done on class definitions so that
generic classes that are not collections can be created. For example, will
the following be valid in VB.Net 2005?
Public Class MyGenericClass(Of MyType)
Private data1 As MyType
Public Sub New(Of MyType) (newData as MyType)
data1 = newData
End Sub
Public Sub DoStuff(Of MyType) (data As MyType, repeat As Long)
'Do stuff
End Sub
End Class
Thanks again.
Robby.
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uU**************@tk2msftngp13.phx.gbl...
Hi,
In vb.net 2005 they will be supported.
http://msdn2.microsoft.com/library/x6z0kw1a.aspx
Ken
------------------
"Robby" <ed****@not.my.email.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
In C++ I can write template classes and in C# they have generic classes
that
are something like C++ template classes. Is there currently a why to
write
them in VB? MS is adding C++ type functionality like operator overloading
to VB in version 2.0 of the .Net Framework. Will there be a way in
version
2.0 to write generic classes in VB?
If not does anyone know the syntax to create an instance of a C# generic
class in VB?
Thanks
Robby