Moritz Warning escribió:
On Sun, 24 May 2009 20:49:53 -0300, Ary Borenszweig wrote:
When I compile this code I get "stack overflow" printed in the console.
Anyone know why?
---
int fact(int X)() {
if(X == 0) {
return 1;
} else {
int temp = fact!(
On Sun, 24 May 2009 20:49:53 -0300, Ary Borenszweig wrote:
> When I compile this code I get "stack overflow" printed in the console.
> Anyone know why?
>
> ---
> int fact(int X)() {
> if(X == 0) {
> return 1;
> } else {
> int temp = fact!(X - 1)();
>
Ary Borenszweig wrote:
When I compile this code I get "stack overflow" printed in the console.
Anyone know why?
---
int fact(int X)() {
if(X == 0) {
return 1;
} else {
int temp = fact!(X - 1)();
return X * temp;
}
}
const someVar = fact!(0)();
---
Like Mor
When I compile this code I get "stack overflow" printed in the console.
Anyone know why?
---
int fact(int X)() {
if(X == 0) {
return 1;
} else {
int temp = fact!(X - 1)();
return X * temp;
}
}
const someVar = fact!(0)();
--
Burton Radons wrote:
> I'm writing an XML class. There are two tests for this class, isAncestorOf
> and isDescendantOf, that are implemented in terms of one another. They're
> both const, and look like this:
>
> class Node
> {
> Node parentNode;
> /// ...
>
> /// Return whethe
Ary Borenszweig wrote:
...
>
> BTW, I had to debug inside Descent's code to find this. If I debug it
> using the debugger I'm programming, I can see it stops the execution
> right at the "s.a[i] = m;" line, without saying why (DMD doesn't say
> why). It's not much, but I think it's better than
Hello Ary,
BTW, I had to debug inside Descent's code to find this. If I debug it
using the debugger I'm programming, I can see it stops the execution
right at the "s.a[i] = m;" line, without saying why (DMD doesn't say
why). It's not much, but I think it's better than "Can't evaluate at
compile-
Hello everybody, directly to my problem:
In class A I got a static array of delegates...
class A{
private static alias void delegate() EventHandler;
public static EventHandler[] MyEvent;
static void Foo()
{
foreach(eh; MyEvent) eh();
}
}
...and when I call Foo() from another Thread like...
i
Ary Borenszweig escribió:
Lutger escribió:
bearophile wrote:
...
The second problem is that compile-time functions are nicer, so I'd
like to not use templates when possible. But the following code
doesn't work at compile time, can you tell me why? (I have had to use a
not nice temporary str
Lutger escribió:
bearophile wrote:
...
The second problem is that compile-time functions are nicer, so I'd like to not use templates when possible. But the following code doesn't work at compile time, can you tell me why? (I have had to use a
not nice temporary struct to return the static arr
bearophile wrote:
...
>
> The second problem is that compile-time functions are nicer, so I'd like to
> not use templates when possible. But the following code doesn't work at
> compile time, can you tell me why? (I have had to use a
not nice temporary struct to return the static array)
>
>
I am trying to create a non-dynamic array at compile time, so I have written
this test code:
int sumSqrt(int n) {
int result = 0;
while (n) {
int digit = n % 10;
n /= 10;
result += digit * digit;
}
return result;
}
template GenSquares(int n) {
static if
12 matches
Mail list logo