Yet another terrible compile time argument proposal
zjh
fqbqrr at 163.com
Mon Jan 15 03:38:11 UTC 2024
On Sunday, 14 January 2024 at 21:27:44 UTC, Steven Schveighoffer
wrote:
> I'm going to propose something that furthers the baggage of
> `enum`, but that is the tool we currently have... Happy to
> think about better syntax. But why not just:
>
> ```d
> void foo(T)(T x, enum string s)
> {
> pragma(msg, s); // s is compile-time
> }
>
Formatting string is essentially a `compile time` parameter,
placed within a runtime parameter and using a `sliding template`
is a great idea.
Sometimes, the parameters of some functions require both
`compilation time and runtime`! I think it would be great to
create a `sliding template` for uniformity.
More information about the Digitalmars-d
mailing list