How can I check to see if template type is an array?

Paul Backus snarwin at gmail.com
Tue Jan 19 22:45:19 UTC 2021


On Tuesday, 19 January 2021 at 22:38:41 UTC, Tim wrote:
> On Tuesday, 19 January 2021 at 22:36:47 UTC, Paul Backus wrote:
>> On Tuesday, 19 January 2021 at 22:34:04 UTC, Tim wrote:
>>> On Tuesday, 19 January 2021 at 22:31:47 UTC, Paul Backus 
>>> wrote:
>>>> You've almost got it. The correct syntax is `is(T == U[], 
>>>> U)`. You can read it as "there exists some type U such that 
>>>> T == U[]".
>>>
>>> Thanks! Do I need to specify U in the template function?
>>
>> No, only inside the is(...) expression.
>
> What if it is a static array i.e. double[3]?

is(T == U[n], U, size_t n)


More information about the Digitalmars-d-learn mailing list