Rhyme and reason for function annotations?

Andy Valencia dont at spam.me
Mon Nov 4 00:01:20 UTC 2024


A function can be described as, say, private, or pure, or @nogc.  
When does an annotation have an '@'?  Also, a function can be 
annotated

int myfunc(char *arg) pure {
}

Although I find:

pure int myfunc(char *arg) {
}

Also works.  So what annotations have @'s, and when do they go 
with the function declaration, and when do they go after the 
argument declaration?

I don't need an exhaustive list, I'm much more interested in the 
underlying philosophy which assigns what to where.

Thank you!
Andy Valencia



More information about the Digitalmars-d-learn mailing list