wolfmat said:Toma, C#, right?
The = operator doesn't just work on Lists in a specific manner; rather, it just happens to also work on Lists like it does everywhere else. In that regard, the described behavior is to be expected. (Especially if you consider that the = operator cannot be overloaded in C#)
If you're absolutely sure you have to clone a collection along with all its data, then there are multiple ways to go about it.
From an object-oriented programmer's point of view, I'd probably build a factory method that returns a new instance of an element's type that holds the identical data, then write an extension that uses said factory method on each element in your source list, and puts each result of the factory method into your newly-built result list, then returns that at the end. Or something.
From a hacker's point of view, I'd assure shit's [Serializable()] and implements ISerialize; then I'd binary-serialize into a memory stream, then deserialize into a null object. That might be a hack, but it's a rather good one.
Yeah I did use the OOP method you mentioned. I thought that was just a work around for something more easier. Someone said earlier: "If you need to write 50 lines of code for something, there is probably an easier way.", so I thought I was thinking about it too complicated. That serializable stuff doesnt seem to be shorter as well, but I didnt figure out how to properly use it. But if I can do anything with that OOP method, and I dont necessarily need the serializable stuff, thats fine by me.