www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8947] New: redBlackTree() of fixed size arrays


           Summary: redBlackTree() of fixed size arrays
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc

--- Comment #0 from bearophile_hugs eml.cc 2012-11-02 12:40:52 PDT ---
I think redBlackTree() has problems with fixed size arrays:

import std.container: redBlackTree, RedBlackTree;
void main() {
    int[2] a;
    auto t1 = new RedBlackTree!(typeof(a));
    t1.stableInsert(a); // OK
    auto t2 = redBlackTree(a);
    t2.stableInsert(a); // Error
    t2.stableInsert(1); // No error, but it's wrong

DMD 2.061alpha gives:

test.d(7): Error: template
std.container.RedBlackTree!(int).RedBlackTree.stableInsert does not match any
function template declaration
...\dmd2\src\phobos\std\container.d(5834): Error: template
std.container.RedBlackTree!(int).RedBlackTree.stableInsert cannot deduce
template function from argument types !()(int[2u])

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