Template value inference: closing the UFCS gap for template value parameters (or, "foo".format(bla) as a template instantiation)

Olivier FAURE couteaubleu at gmail.com
Mon Aug 5 08:42:29 UTC 2019


On Monday, 5 August 2019 at 06:49:32 UTC, FeepingCreature wrote:
> Since D templates have value parameters, this suggests an 
> analogous process of template value inference. How would this 
> look?
>
> void format(string fmt, T...)(fmt, T args);

I'd suggest

     void format(enum Fmt: string, T...)(Fmt fmt, T args);

That said, does the use case of needing UFCS with a template for 
a formatting string come up *that* often?


More information about the Digitalmars-d mailing list