On Sun, 24 May 2009 06:45:51 +1200, Bill Baxter wbax...@gmail.com wrote:
Yeh, denied because search is really hard.
So they cant just insert an if statement on the line before to check for
exact match before trying the search?
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
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)
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
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
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
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 Can't
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 whether this is
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)();
---
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
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)();
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!(X
12 matches
Mail list logo