Sanity check: pithiest test for static if: "is an array of ubyte"

Andy Valencia dont at spam.me
Sun May 25 01:34:36 UTC 2025


On Sunday, 25 May 2025 at 01:06:12 UTC, Steven Schveighoffer 
wrote:
> static if(isArray!(typeof(arg))) && is(typeof(arg[0]) == ubyte))
> ```
>
> Note that even if arg.length is 0, this is fine, because the 
> expression isn't actually executed.
>
> Hope this helps you to understand the issue.

Actually, I was a little bit curious about the case where my arg 
_was_ zero length... that addresses it nicely.  Thank you.

Andy



More information about the Digitalmars-d-learn mailing list