ubyte[] -> immutable(ubyte)[]

Andrej Mitrovic test at test.test
Fri Sep 10 08:15:38 PDT 2010


Yeah, one would think the destination is on the left (just like the standard C way of doing it), but it's not. I checked it in the docs and the source. And idup works, thanks.

Kagamin Wrote:

> Andrej Mitrovic Wrote:
> 
> >     foreach (ubyte[] buffer; stdin.byChunk(bufferSize))
> >     {
> >         immutable(ubyte)[] copy_buffer;
> >         copy(buffer, copy_buffer);
> >         
> >         writeln(copy_buffer);  // writes nothing
> > 
> >         send(tid, copy_buffer);
> >     }
> 
> Isn't destination the left argument?
> Why you don't use send(tid, buffer.idup);
> ?



More information about the Digitalmars-d-learn mailing list