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

Andy Valencia dont at spam.me
Sat May 24 20:29:52 UTC 2025


The best I"ve come up with for a "static if" to see if 
something's an array of ubyte:

```d
(isArray!(typeof(arg))) && is(typeof(arg).init[0] == ubyte)
```

Which doesn't seem to work, but it's the closest I've come by 
poring over the docs and reading Phobos source.

TIA!
Andy



More information about the Digitalmars-d-learn mailing list