digitalmars.D.learn - DList bug or programmer error?
- Daniel K (18/18) Apr 12 2014 This block of code fails the second assert, why? Using
- monarch_dodra (3/4) Apr 12 2014 Because DList is buggy. It should pass.
This block of code fails the second assert, why? Using stableRemove{Front,Back} does not fix it. ---- import std.range; import std.container; unittest { auto dl2 = DList!int([2,7]); dl2.removeFront(); //dl2.stableRemoveFront(); assert(dl2[].walkLength == 1); dl2.removeBack(); //dl2.stableRemoveBack(); assert(dl2.empty, "not empty?!"); } void main(){ } ---- rdmd -unittest file.d
Apr 12 2014
On Saturday, 12 April 2014 at 19:34:11 UTC, Daniel K wrote:This block of code fails the second assert, why?Because DList is buggy. It should pass. I have an open pull that fixes this, FYI.
Apr 12 2014