Reducing variadic template combinatorics (C++ was onto something)
Quirin Schroll
qs.il.paperinik at gmail.com
Wed Oct 15 11:40:18 UTC 2025
On Tuesday, 14 October 2025 at 04:30:49 UTC, Steven Schveighoffer
wrote:
> In a conversation on a pull request for one of my libraries, I
> came across an interesting revelation. Variadic template
> functions waste resources for the most part, because much of
> the time, you don't care about the *relationship* between the
> parameters. In many such functions, you just process them in a
> loop.
>
> […]
>
> But... I still want to write `writelines(1, 2, 3, 4)`. The
> ergonomics there are nice! Is there some way we can capture
> this same reduction in complexity while still keeping the nice
> syntax?
Yes, macros. C++ was onto something.
More information about the Digitalmars-d
mailing list