Templates and stringof...

Philippe Sigaud philippe.sigaud at gmail.com
Sat Aug 4 04:29:26 PDT 2012


On Sat, Aug 4, 2012 at 10:25 AM, David Nadlinger <see at klickverbot.at> wrote:

> An example of what I mean: Try this with your CurryTemplate from dranges:
>
> ---
> import dranges.templates;
>
> template Foo(A, B) {
>     pragma(msg, A.stringof, " ", B.stringof);
> }
>
> alias CurryTemplate!Foo FooCurried;
> alias FooCurried!int FooInt;
> alias FooInt!string Test;

Oh, I completely forgot this. Nice code, if I may say so myself :)

But yes, having identifiers going back and forth between modules is
difficult. I didn't realize this in 2009, while most of dranges was
written.
Now, since I regularly need to have a template work on local
identifiers, I tend to use mixins much more than in dtemplates.


More information about the Digitalmars-d-learn mailing list