Bug 8884 – std.array RefAppender do not works with .ptr

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-24T05:32:00Z
Last change time
2012-10-24T07:08:38Z
Assigned to
nobody
Creator
bioinfornatics

Comments

Comment #0 by bioinfornatics — 2012-10-24T05:32:25Z
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 ); }
Comment #1 by bioinfornatics — 2012-10-24T07:08:38Z
after bernardth explanation i see that is not a but but diferrence between & and .ptr is a little confusing