To conclude the matter regarding the absence of a FIFO stack in the
standard library and the not so good alternative of arrays (in
particular where there are a significant number of push-pops and the
maximum length is not initially known):
Does anyone in-the-know know if something like DList (a
What do you think about a rewrite rule that changes code like:
int[int] aa = [1:2, 3:4];
void main() {}
Into:
int[int] aa;
static this() {
aa = [1:2, 3:4];
}
void main() {}
Bye,
bearophile
Hello,
I want to compute, for example
d = a + b + c
where a..d are of some derived type, without incurring the cost of temporaries
for each overloaded operation.
In a similar post a while ago, Walter Bright proposed using function literals
instead of template expressions to do this. After
Le 28/10/2011 19:18, Dominic Jones a écrit :
Hello,
I want to compute, for example
d = a + b + c
where a..d are of some derived type, without incurring the cost of temporaries
for each overloaded operation.
In a similar post a while ago, Walter Bright proposed using function literals
instead
bearophile bearophileh...@lycos.com wrote in message
news:j8eflp$q3o$1...@digitalmars.com...
What do you think about a rewrite rule that changes code like:
int[int] aa = [1:2, 3:4];
void main() {}
Into:
int[int] aa;
static this() {
aa = [1:2, 3:4];
}
void main() {}
You generally
Nick Sabalausky:
So as nice as it would be to use AA initializers at the module-level, this
carries a hidden danger which could be a royal PITA to debug (especially for
D newbies), so I don't think it's a good thing to do.
I see. Thank you for your answer.
Bye,
bearophile