www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5522] New: std.range.zip fails on arrays of Object.

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

           Summary: std.range.zip fails on arrays of Object.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: blood.of.life gmail.com



06:44:31 PST ---
import std.range;

void main()
{
    auto a = new Object[10];
    zip(a);
}

Results in the following error:

/usr/include/d/std/range.d(2814): Error: template std.conv.emplace(T,Args...)
if (!is(T == class)) does not match any function template declaration
/usr/include/d/std/range.d(2814): Error: template std.conv.emplace(T,Args...)
if (!is(T == class)) cannot deduce template function from argument types
!()(Object*,Object)
/usr/include/d/std/range.d(2818): Error: template std.conv.emplace(T,Args...)
if (!is(T == class)) does not match any function template declaration
/usr/include/d/std/range.d(2818): Error: template std.conv.emplace(T,Args...)
if (!is(T == class)) cannot deduce template function from argument types
!()(Object*)

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


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


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




Created an attachment (id=956)
Patch std.conv to allow  emplace(ClassType* addr, [ClassType obj])

The problem is std.conv.emplace cannot emplace a class-object T into a T*
pointer, which is explicitly filtered out in several specializations. I don't
know why. Here is a patch which simply add the required specializations. (I
have not throughoutly checked if it breaks any unittests other than std.conv.)

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


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|                            |dmitry.olsh gmail.com
         Resolution|                            |FIXED



04:17:27 PDT ---
Fixed in:
https://github.com/D-Programming-Language/phobos/commit/65a0c2158b1d2ea8e9d3094746739da636266089

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