This Week in D #37 - forum tutorials and tip on using UDAs
Jacob Carlborg via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Tue Sep 29 07:04:32 PDT 2015
On 2015-09-29 14:10, Adam D. Ruppe wrote:
> Though, I just had an idea on how that might be simplified.... don't
> recreate them, just alias them!
>
>
>
> So, conceptually, you'd do something like:
>
>
> template transformer(alias member) {
> static if(hasUDA!(member, thing))
> mixin(transformed_version_of_member());
> else
> alias member = member;
> }
> mixin staticMap!(AllMembers!impl_module, transformer);
This looks even more interesting :)
--
/Jacob Carlborg
More information about the Digitalmars-d-announce
mailing list