problem with gc?

2015-05-26 Thread zhmt via Digitalmars-d-learn
I am writing a echoclient, as below: Ptr!Conn conn = connect(127.0.0.1,8881); ubyte[100] buf; for(int i=0; iN; i++) { scope string str = format(%s,i); conn.write((cast(ubyte*)str.ptr)[0..str.length]); conn.read(buf[0..str.length]); n++; } conn.close(); When it

Re: problem with gc?

2015-05-26 Thread zhmt via Digitalmars-d-learn
I noticed that the cpu% falls from 99% down to 4% as well when the throughput falls down.

Re: Lazy variadic not working, any alternatives?

2015-05-26 Thread Tofu Ninja via Digitalmars-d-learn
On Tuesday, 26 May 2015 at 05:54:11 UTC, John Colvin wrote: Something like this appears to work: import std.typetuple : allSatisfy; enum implicityConvertibleToBool(T) = is(T : bool); bool tok_and(Args...)(lazy Args terms) if(allSatisfy!(implicitlyConvertibleToBool, Args)) { auto

Re: Lazy variadic not working, any alternatives?

2015-05-26 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 26 May 2015 at 06:04:59 UTC, Tofu Ninja wrote: On Tuesday, 26 May 2015 at 05:54:11 UTC, John Colvin wrote: Something like this appears to work: import std.typetuple : allSatisfy; enum implicityConvertibleToBool(T) = is(T : bool); bool tok_and(Args...)(lazy Args terms)

Re: Lazy variadic not working, any alternatives?

2015-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/25/15 11:53 PM, Tofu Ninja wrote: On Tuesday, 26 May 2015 at 05:43:59 UTC, Tofu Ninja wrote: On Tuesday, 26 May 2015 at 05:22:26 UTC, Tofu Ninja wrote: Actually the code seems to compile on 2.067.1 but definitely does not work as expected. ... I guess it stems from the fact that its lazy