Finding UDAs with Templates

Jacob Carlborg doob at me.com
Tue Jul 23 04:22:59 PDT 2013


On 2013-07-23 12:59, Artur Skawina wrote:

> We can. :)
>
>     enum attrs = __traits... // `auto` would work too.

I can't remember that working for me, but perhaps it does.

> Just be careful and remember the `typeof(attrs)` part if/when
> using staticIndexOf with types - it might otherwise return bogus
> results (instead of failing).
>
>     staticIndexOf!(Sync, typeof(attrs))

Yeah, I think I encountered something like that.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list