Proposal: user defined attributes

F i L witte2008 at gmail.com
Sun Mar 18 04:16:53 PDT 2012


F i L wrote:
>     struct Test {
>         int value;
>         this() { GC.setAttr(&value, NO_SCAN); }
>     }

bleh, should be...

     struct Test {
         int value;
         this(int v) { GC.setAttr(&value, GC.BlkAttr.NO_SCAN); }
     }

Or something like that. I've never actually set GC attributes 
before.

But this also raises another issue. Structs don't have default 
constructors, so applying NoScan attributes (by default) is, to 
my knowledge, impossible. Whereas it could (?) be possible 
through attributes.


More information about the Digitalmars-d mailing list