On Wed, 13 May 2009 10:48:53 +0400, grauzone n...@example.net wrote:
Maybe it's time to put together an instrumented GC...
Wishlist:
- some way to know _when_ a collection happened (or how often)
- logging of allocations (module/linenumber of allocator, size of
allocation, type of
grauzone wrote:
Wild guess: there's a false pointer, that keeps one element in the list
from being collected, and because the list-prev pointers are still
there, all following elements won't be collected either in consequence.
If I had time, I'd try two experiments:
1. before freeing
Thanks.The construct is clear now.
Still leaves Q1,that is ,the *if* expression after the template definition,I
want to learn more about the usage,where can I find more information?
and one more question here:
Q4.In the delegate somFnExp:front(),popFront,empty() are all not
defined??Anyway it
It can compile if import std.typecons and modify as below:
import std.typecons;
import std.algorithm;
void main()
{
double[] a=[3.0,4,7,11,3,2,5];
auto ret=reduce!(a+b,a+b*b)(tuple(0.0,0.0),a);
}
Here a explicit tuple is needed.
Sam Hu Wrote:
Thanks.The construct is clear now.
Still leaves Q1,that is ,the *if* expression after the template definition,I
want to learn more about the usage,where can I find more information?
It is in the spec: http://www.digitalmars.com/d/2.0/template.html#Constraint
Denis Koroskin wrote:
At work, we manage memory ourselves (C++ that is). As result of a
program run, a memory log is created which is then visualized by a
Memory Monitor. MM gives a picture of memory state at any given time.
You use a scroller to advance in time. You may a watch a history of
Sam Huwrote:
Q4.In the delegate somFnExp:front(),popFront,empty() are all not
defined??Anyway it is not an interface ,so why it is allowed?
Basically, is(typeof(X)) is D magic.
One could interpret it as 'is X a valid type', or perhaps more
correctly as 'does X compile'. So if SomeFnExp does
Simen Kjaeraas wrote:
Sam Huwrote:
Q4.In the delegate somFnExp:front(),popFront,empty() are all not
defined??Anyway it is not an interface ,so why it is allowed?
Basically, is(typeof(X)) is D magic.
One could interpret it as 'is X a valid type', or perhaps more
correctly as 'does X
Hi All,
Thank you so much! It really helps!
Regards,
Sam
On Tue, 12 May 2009 14:50:26 -0400, saotome
saotome@googlemail.com wrote:
Hi all,
i want to declare an invariant interger, for instance invariant int x = 3;.
But i've got this error while compiling.
Error: constant 3 is not an lvalue
could someone explain me what's wrong here ? I'm using
Taken straight from http://www.digitalmars.com/d/1.0/arrays.html, this doesn't
compile:
void main()
{
string str = abc;
char* p = str; // pointer to 1st element
}
Error: cannot implicitly convert expression (str) of type char[] to char*
I agree it shouldn't
Doctor J schrieb:
Taken straight from http://www.digitalmars.com/d/1.0/arrays.html, this doesn't
compile:
void main()
{
string str = abc;
char* p = str; // pointer to 1st element
}
Error: cannot implicitly convert expression (str) of type char[] to char*
On Wed, 13 May 2009 14:28:46 -0400, Doctor J nob...@nowhere.com wrote:
Taken straight from http://www.digitalmars.com/d/1.0/arrays.html, this
doesn't compile:
void main()
{
string str = abc;
char* p = str; // pointer to 1st element
}
Error: cannot
Gide Nwawudu:
Not sure the following code works for me.
invariant int x = 3;
void main() {
}
And now it's better to start using immutable instead of invariant that is
probably deprecated. I guess invariant will be removed in some time.
Bye,
bearophile
14 matches
Mail list logo