www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5640] New: error with constructing RedBlackTree from range of array (typesafe variadics)

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5640

           Summary: error with constructing RedBlackTree from range of
                    array (typesafe variadics)
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: lutger.blijdestijn gmail.com



PST ---
The following does not compile:

auto tree = RedBlackTree!string("foo", "bar", "baz");

Error message:

Error: template std.container.RedBlackTree!(string).RedBlackTree.__ctor(U) if
(isImplicitlyConvertible!(U,Elem)) does not match any function template
declaration
Error: template std.container.RedBlackTree!(string).RedBlackTree.__ctor(U) if
(isImplicitlyConvertible!(U,Elem)) cannot deduce template function from
argument types !()(string,string,string)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 22 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5640




PST ---
It is an issue with type inference from typesafe variadics, the constructor for
RedBlackTree deduces U to immutable(char) rather than string:

this(U)(U[] elems...) if (isImplicitlyConvertible!(U, Elem))

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 22 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5640


Ellery Newcomer <ellery-newcomer utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ellery-newcomer utulsa.edu
         Resolution|                            |WORKSFORME



14:49:42 PDT ---
auto tree = redBlackTree!string("foo", "bar", "baz");

compiles with dmd 2.059

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