static if check for array and AA
Sean Kelly
sean at f4.ca
Thu Jun 22 12:46:37 PDT 2006
Oskar Linde wrote:
> In article <e7djp7$42g$1 at digitaldaemon.com>, Kirk McDonald says...
>
>> It turns out the above template fails because "is(typeof(T.init[0]))"
>> fails, as it doesn't describe a valid type. (You can't subscript an int!)
>
> Yes. I've been reporting this a couple of time, but never gotten any (official)
> response on whether this is
> the intended behavior. Static arrays are the only type for which typeof(T.init)
> != T.
This is also somewhat close to implementation-specific behavior. I'd
prefer to have a more formal means of detecting static arrays.
Sean
More information about the Digitalmars-d
mailing list