Idea: limited template expansion
David Nadlinger via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jan 20 15:01:20 PST 2016
On Wednesday, 20 January 2016 at 22:00:45 UTC, Steven
Schveighoffer wrote:
> Imagine if you such a call returned something, and you simply
> used it throughout the rest of your function. The compiler
> could rewrite this as a template and compile all three versions
> and branch to the appropriate one, but your code would simply
> read as a straightforward procedural function.
But if you abstract away the dispatch part into a (meta)template
function like I suggested, the caller would still be just as
linear, right?
How would the client code be simpler with a built-in language
feature?
— David
More information about the Digitalmars-d
mailing list