[Issue 5764] New: RedBlackTree cannot be empty

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 21 12:58:01 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5764

           Summary: RedBlackTree cannot be empty
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: tbolsh at gmail.com


--- Comment #0 from Timofei Bolshakov <tbolsh at gmail.com> 2011-03-21 12:54:44 PDT ---
It is imposible to create an empty RedBlackTree:

<pre>
#!/usr/bin/rdmd
import std.stdio, std.conv, std.container;
void main(){
    RedBlackTree!ubyte empty_rbt;
    writeln( empty_rbt.empty );
}
</pre>
generates
<pre>
core.exception.AssertError@/usr/include/d/dmd/phobos/std/container.d(3556):
null this
----------------
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(onAssertErrorMsg+0x36)
[0x80a8416]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_d_assert_msg+0x18)
[0x809fb98]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D3std9container13__T6RBNodeThZ6RBNode4leftMFNdZPS3std9container13__T6RBNodeThZ6RBNode+0x31)
[0x809737d]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D3std9container20__T12RedBlackTreeThZ12RedBlackTree5emptyMFNdZb+0x3b)
[0x8096e53]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_Dmain+0x14)
[0x8096ab8]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D2rt6dmain24mainUiPPaZi7runMainMFZv+0x1a)
[0x809fd46]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20)
[0x809fcd8]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D2rt6dmain24mainUiPPaZi6runAllMFZv+0x32)
[0x809fd8a]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(_D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv+0x20)
[0x809fcd8]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5(main+0x94)
[0x809fc84]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb75f0bd6]
/tmp/.rdmd/home/tbolshakov/projects/D/test.d.29218FB0A11840E9986B31A5F7D7F2E5()
[0x80969f1]
</pre>
So, it complicates working with the container.
The dmd version:
<pre>
Digital Mars D Compiler v2.052
Copyright (c) 1999-2011 by Digital Mars written by Walter Bright
Documentation: http://www.digitalmars.com/d/2.0/index.html
</pre>

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list