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
On Saturday, 24 May 2025 at 20:29:52 UTC, Andy Valencia wrote:
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 t
On Saturday, 24 May 2025 at 21:58:16 UTC, H. S. Teoh wrote:
static if (is(typeof(myArray) == ubyte[])) {
...
}
Oh! I knew I was missing something. Thank you to both of you
for pointing at this.
Andy
On Saturday, 24 May 2025 at 20:29:52 UTC, Andy Valencia wrote:
The best I"ve come up with for a "static if" to see if
something's an array of ubyte:
OK, so e.g. `ubyte[] arg`.
```d
(isArray!(typeof(arg))) &&
```
That's fine.
is(typeof(arg).init[0] == ubyte)
1. Unfortunately `typeof(arg)
On Sat, May 24, 2025 at 08:29:52PM +, Andy Valencia via Digitalmars-d-learn
wrote:
> 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)
> ```
That's totally overkill. Just do this:
On Saturday, 24 May 2025 at 20:29:52 UTC, Andy Valencia wrote:
The best I"ve come up with for a "static if" to see if
something's an array of ubyte:
is(typeof(arg) == ubyte[])
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
On Friday, 23 May 2025 at 13:10:47 UTC, Dennis wrote:
I recommend keeping it simple, cover common cases and don't try
to make it perfect, because it won't be. But if you do somehow
make it perfect, post your results, I'd love to see it!
When you look at it through my glasses (graphical IDE), I
On Friday, 23 May 2025 at 22:11:58 UTC, Ali Çehreli wrote:
On 5/23/25 6:10 AM, Dennis wrote:
> This results in a complex system that's more annoying to deal
with than
> the original problem of just maintaining a .d file and shader
file in
> parallel, which is what I'm doing now for the time bein