Do strings with enum allocate at usage point?

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Mar 18 04:07:32 PDT 2015


岩倉 澪:

> However, if enum implies allocation at the usage point for 
> strings,

There are two ways to see if something allocates: there is a 
compiler switch, and an annotation:

void foo() @nogc {
     // Your code here
}

If the compiler doesn't have a bug it will complain if you put 
something that allocates inside that function.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list