On Wednesday 25 August 2010 12:48:22 Steve Schveighoffer wrote: > Alright, I have now a working Appender to replace the current one (along > with the appropriate changes to phobos). > > This one should be completely usable in safe mode save a couple of > functions (clear and shrinkTo). > > Before I commit, I want to get the opinions of others on this: > > One very very notable difference from the original appender is it does not > take a pointer as the parameter. This means it does not update the > original array you pass to it (well, it does, but will not modify the > length). There was only really a couple places in phobos that used this > to an advantage, most places that used appender had code like this: > > string buf; > auto app = appender(&buf); > > And then never used buf again. > > So I'm wondering how much this feature is needed (affecting the original > array). I feel its a very unsafe method of passing an array around, > especially when we have perfectly safe ways, and the updated version of > the array is available via the data property.
I've never liked the fact that appender worked that way, and that's part of the reason that I haven't used it much. I'm all for a safer implementation. Of course, because I haven't use appender much, my take on things could be quite a bit different from those who have (and they're the ones who are going to be affected most by this). - Jonathan M Davis _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
