Frist Draft (in this forum): Enum Parameters
Meta
jared771 at gmail.com
Tue May 7 22:32:04 UTC 2024
On Tuesday, 7 May 2024 at 17:44:25 UTC, Paul Backus wrote:
> If a single function in a call stack forgets to pass a given
> parameter by `ref`, it will be copied. If your code relies on
> the parameter not being copied (e.g., if it has a disabled copy
> constructor), this failure to preserve `ref` results in a bug.
>
> If a single function in a call stack forgets to pass a given
> parameter by `enum`, it will be evaluated at runtime. If your
> code relies on the parameter being evaluable at compile time
> (e.g., if it uses it as a template argument or in a `static if`
> condition), this failure to preserve `enum` results in a bug.
Won't this always result in a compile error, not a runtime bug?
More information about the dip.development
mailing list