UDA magic?
evilrat
evilrat666 at gmail.com
Thu Apr 17 06:34:19 PDT 2014
On Thursday, 17 April 2014 at 13:22:01 UTC, Dicebot wrote:
> Right now it is impossible by the design of feature. UDA's are
> just bits of information attached to symbols. They don't affect
> type of symbol and their own type is affected by symbol either.
> Such enhancement is theoretically possible but that would have
> been a very big change.
>
> Current idiomatic way to do such stuff is to have single mixin
> statement that iterates over all symbols of a module and does
> something for those that have specific UDA attached:
>
> @token!42
> void foo() {}
>
> mixin registerAllTokens!modname;
ok. i just thinking this is the way, but was hoped not only way
though :(
thanks everyone for clarification.
More information about the Digitalmars-d-learn
mailing list