Re: Map with maintained insertion order

2012-03-25 Thread Michael Rynn
; > When iterating over map keys I want to visit "foo" first, then "bar", > and so on. http://bazaar.launchpad.net/~michael-rynn-500/d2-xml/trunk/view/head:/alt/ arraymap.d I took and adapted the idea from Ultimate++ library code. Ultimate++ is worth a try, even if it

Re: delete an element from an array

2010-10-26 Thread Michael Rynn
On Sun, 24 Oct 2010 13:02:24 +0200, Adam Cigánek wrote: > Hello, > > Is there a function in the standard library to delete an element from an > array (or range)? Something like: > > auto a = [1, 2, 3, 4, 5, 6]; > auto b = delete(a, 4); > > assert([1, 2, 3, 4, 6] == b); > > I've noticed t

range properties that work in foreach

2010-03-06 Thread Michael Rynn
On the D2 online pages (http://www.digitalmars.com/d/2.0/statement.html#ForeachStatement)there is Foreach over Structs and Classes with Ranges My question is , is there a working example of foreach ( e ; range )? Iteration over struct and class objects can be done with ranges, which means

Best way to clear dynamic array for reuse

2016-12-28 Thread Michael Rynn via Digitalmars-d-learn
It takes a bit of work to get around the mutable buffers problem in D language arrays. I found it made a performance difference in xml parsing. https://github.com/betrixed/dlang-xml/blob/master/xml/util/buffer.d /** Buffer(T) - Versatile appendable D array for buffer reuse, append, re