The @nogc attribute is implemented in d?

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?

+4
source share
2 answers

@nogc is a new attribute and was first implemented in DMD 2.066.

+7
source

, @nogc, DMD v2.066. , - ( 2014 ). DMD 2.066 , , D . , , D.

0

All Articles