3 ms·
D-lang attributes can be used like a label, so for example you can put at the top of your file: @safe nogc: auto myFunc() { // do stuff } struct B
by gavinray 4y ago
D-lang attributes can be used like a label, so for example you can put at the top of your file:
@safe nogc:
auto myFunc() { // do stuff }
struct Blah {}
Whatever attributes you use apply to all code in the lexical scope below the colon.
It's useful for structs/classes
struct MyThing {
auto unsafeFunc() {}
@safe:
auto safeFunc1() {}
}