On 5/3/16 5:31 PM, vino wrote:
On Friday, 10 September 2010 at 15:15:38 UTC, Andrej Mitrovic wrote:
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:
An
On Friday, 10 September 2010 at 15:15:38 UTC, Andrej Mitrovic
wrote:
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:
> fo
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))
> > {
> >
Ah, idup. Too obvious, but I missed it. Thanks.
Pelle Wrote:
> std.algorithm.copy will copy an input range into an output range. An
> array is a valid output range, but does not append as you seem to
> expect. Instead, it fills the array.
>
> int[] a = new int[](3);
> copy([1,2,3],a);
> assert
bearophile Wrote:
> Andrej Mitrovic:
> > I'm trying to use algorithm.copy, but I get back nothing in the copy
> > buffer. How do I to copy an array of ubyte's?
>
> a[] = b[];
>
> Bye,
> bearophile
No, that wouldn't work. It complains about conversion from mutable to
immutable. idup works fin
On 09/10/2010 04:40 AM, Andrej Mitrovic wrote:
I'm trying to use algorithm.copy, but I get back nothing in the copy buffer.
How do I to copy an array of ubyte's?
iimport std.algorithm,
std.concurrency,
std.stdio;
void main()
{
enum bufferSize = 4;
auto tid = spawn(&
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
Andrej Mitrovic:
> I'm trying to use algorithm.copy, but I get back nothing in the copy buffer.
> How do I to copy an array of ubyte's?
a[] = b[];
Bye,
bearophile
I'm trying to use algorithm.copy, but I get back nothing in the copy buffer.
How do I to copy an array of ubyte's?
iimport std.algorithm,
std.concurrency,
std.stdio;
void main()
{
enum bufferSize = 4;
auto tid = spawn(&fileWriter);
// Read loop
foreach (ubyte[
This is from TDPL page 407:
import std.algorithm,
std.concurrency,
std.stdio;
void main()
{
enum bufferSize = 1024 * 100;
auto tid = spawn(&fileWriter);
// Read loop
foreach (immutable(ubyte)[] buffer; stdin.byChunk(bufferSize))
{
send(tid, buffer);
10 matches
Mail list logo