Proposal: user defined attributes

dennis luehring dl.soluz at gmx.net
Mon Mar 19 01:20:56 PDT 2012


i don't get the GC relation here?

all attribute values are static const - because they are type-related 
(static) and read-only, attributes are type orientated not instance 
orientated

> @GC.NoScan int value;
> @GC this() {}
>
> Compiler Asks library for transformation of unknown @GC
> bool library("@GC this() {anything...}") ->
>
> if the library succeeds it would then transform the string and
> hand back a lowered mixin to the compiler.
>
> mixin("
> this()
> {
>     auto b = [ __traits(allMembers, D) ];
>     foreach( auto a; b) {DO.GC.Stuff...}
>
>     anything...
> }
> ");
>
>





More information about the Digitalmars-d mailing list