UDA usage

Matt Soucy msoucy at csh.rit.edu
Fri Oct 4 19:51:20 PDT 2013


So, I was away from active D development for a while, and I'm having
trouble finding info about how to use UDAs. I can see the basics, like
how to apply a UDA to a symbol, but now how to do specific things, like:
* Check to see if a specific attribute exists
* Check to see if an attribute of a specific type exists, something like:
@Foo('a') int x;
enum hasAnyFoo = __traits(hasAttributeOfType, Foo, x);
* Create a function that can only be called if the first argument has a
UDA of a specific type

Are any of these doable?
Thank you,
-Matt Soucy

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131004/1183e855/attachment.pgp>


More information about the Digitalmars-d-learn mailing list