On Tuesday, October 3, 2023 7:46:42 PM MDT Joel via Digitalmars-d-learn wrote: > I think the if without static is still static, since it's part of > the function name part, or so (outside of the curly bracket > scope).
if on a template (or on a templated function) is a template constraint, in which case, that's a compile-time if like static if, because it's used to indicate whether that particular template can be instantiated with a particular set of arguments. But elsewhere, an if without static is a runtime construct, and you need static on it to make it a compile-time one. https://dlang.org/spec/template.html#template_constraints https://dlang.org/spec/version.html#staticif https://dlang.org/spec/statement.html#if-statement http://ddili.org/ders/d.en/templates.html http://ddili.org/ders/d.en/cond_comp.html http://ddili.org/ders/d.en/if.html - Jonathan M Davis