DList bug or programmer error?

Daniel K danielk.misc at gmail.com
Sat Apr 12 12:34:10 PDT 2014


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


More information about the Digitalmars-d-learn mailing list