www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8884] New: std.array RefAppender do not works with .ptr

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

           Summary: std.array RefAppender do not works with .ptr
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bioinfornatics gmail.com



05:32:25 PDT ---
it seem RefAppender do not works with .ptr array property


_____________________________________
This code give: [0, 1, 2, 3, 4, 5, 6, 7] 
-----------------------
import std.stdio;
import std.array;

void main(){
    size_t[] a =[ 0,1,2,3 ];

    auto a2 = appender( &a );
    a2.put( [4, 5, 6, 7 ] );
    writeln( a );
}
_____________________________________
This code give: 
Error: template std.array.appender does not match any function template
declaration
Error: template std.array.appender cannot deduce template function from
argument types !()(ulong*)
-----------------------
import std.stdio;
import std.array;

void main(){
    size_t[] a =[ 0,1,2,3 ];

    auto a2 = appender( a.ptr );
    a2.put( [4, 5, 6, 7 ] );
    writeln( a );
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8884


bioinfornatics <bioinfornatics gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



07:08:38 PDT ---
after bernardth explanation i see that is not a but but diferrence between &
and .ptr is a little confusing

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