On Saturday, February 11, 2012 18:01:05 Nick Sabalausky wrote: > But not all slices are slices of dynamic arrays.
But all slices are still dynamic arrays, even if they refer to a static array. They just have a capacity of 0, so any appending will result in them being reallocated. And slicing static arrays is one of those things that you generally have to be careful about precisely because they aren't managed by the GC and can go out of scope before their slices do. > Yea, manual memory management is hard and you have to be careful. That's > true slices or not. Yes, but in this case, you're dealing with a language feature which is _designed_ to be managed by the GC. It's not designed for manual memory management at all. It's a completely different situation when you're dealing with user-defined types. > Arrays knowing their own length *is* a notable improvement over C. Indeed, but that's pretty much the only improvement that D makes to arrays which is safe to use without a GC without being _very_, _very_ careful. - Jonathan M Davis