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

Dennis dkorpel at gmail.com
Tue Jan 19 22:31:29 UTC 2021


On Tuesday, 19 January 2021 at 22:26:52 UTC, Tim wrote:
> I need to be able to check in a template whether the type given 
> is an array type so that I can do some different logic. How can 
> I do this?

`if(is(T == E[], E))` or `isDynamicArray!T` is you `import 
std.traits;`


More information about the Digitalmars-d-learn mailing list