I made a small program in D that calculates Fibonacci numbers. This was supposed to be the most efficient since I did this to compare D execution speed with other languages. Then I read about the @nogc attribute on dlang.org (here: http://dlang.org/attribute#nogc ) and tried to use it like this:
@nogc
@safe
uint fibonacci(uint index)
{
if(index < 2)
return index;
return fibonacci(index - 2) + fibonacci(index - 1);
}
I tried with DMD 2.065 and GDC 4.8.2, but both told me: Error: undefined identifier nogc
Am I doing something wrong? Is @nogc just not implemented right now?
source
share