Re: std.array.Appender with fixed size arrays

2010-06-08 Thread Ali Çehreli
Richard Webb wrote: Hi, While trying to get some things to build in D2, i noticed that the code: import std.array; void main (string[] args) { string s; auto app = appender(&s); app.put(['a', 'b']); } / works, but if it's changed to; char[

Re: std.array.Appender with fixed size arrays

2010-06-08 Thread bearophile
Richard Webb: > char[2] tmp = ['a', 'b']; > app.put(tmp); > > then it fails. Seems to be because char[2] isn't a forward range, so it > doesn't match the version of put that takes a range. > > Is this a bug? Maybe it's not a bug, but it's a limitation. With some more work on the Appender then t

std.array.Appender with fixed size arrays

2010-06-08 Thread Richard Webb
Hi, While trying to get some things to build in D2, i noticed that the code: import std.array; void main (string[] args) { string s; auto app = appender(&s); app.put(['a', 'b']); } / works, but if it's changed to; char[2] tmp = ['a', 'b']; a