I'm implementing a customized Graph algorithm in vb.net, and I'm having the following problem:
Supose the code:
dim col as new collection
dim myC as new system.collections.genericList(of myClass)
dim obj1 as new myClass
dim obj2 as new myClass
myC.add(obj1)
myC.add(obj2)
dim myC2 as new system.collections.generic.list(of myClass)
myC2 = myC
col.add(myc2)
'In the next statement, the myC2 inside col collection will be decreased to contain
'only obj1, like myC. I supose this is for myC and myC2 contains only a pointer to
'objects obj1 and obj2 as well col contains pointers to myC and myC2
myC.remove(obj2)
'The problem is that I have to only copy myC to myC2, like a ByVal argument in a function,
'instead a ByRef argument, in order to mantain a copy of objects in myC2 while these
'objects should be removed from myC. How should I do it?
Thanks for helping...