Hacker News new | past | comments | ask | show | jobs | submit login

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() {}
  }



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: