Bug in std.container: SList
ted via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 13 23:44:40 PDT 2015
Hi,
(earlier posting on D.learn, but better test included here)...
dmd.2.067, dmd.2068 (64bit linux)
import std.container: SList;
void main()
{
SList!int tmp=( 4 );
SList!int tmp1;
// Ensure tmp is empty
tmp.removeAny();
assert( tmp.empty == true );
// Both tmp and tmp1 are empty
// (however tmp1 is not internally initialised)
tmp.insertAfter( tmp[], 3 );
// tmp1.insertAfter( tmp1[], 3 ); <====== asserts here.
}
core.exception.AssertError at std/container/slist.d(57): Assertion failure
Changes in phobos mean that you cannot append to an _uninitialised_ empty
singly linked list (you can, however, append to an _initialised_ empty
linked list.....
bug ?
--ted
More information about the Digitalmars-d
mailing list