Template function : use the array's one !

TSalm TSalm at free.fr
Tue Feb 17 14:11:12 PST 2009


Le Tue, 17 Feb 2009 23:03:04 +0100, BCS <none at anon.com> a écrit:

> Hello TSalm,
>
>>> take a look at static if and is
>>>  http://www.digitalmars.com/d/1.0/version.html#staticif
>>> http://www.digitalmars.com/d/1.0/expression.html#IsExpression
>>>
>> Thanks for this links.
>> But I don't see anything about how to test if it's an array or not...
>> Is it not possible ?
>
> look at point 5
>
> IIRC:
>
> static if(is(T B : B[]))
> {
>     // if T is an array, this is used and B is the element type
> }
>
>


Incredible !
Thanks a lot BCS.


More information about the Digitalmars-d-learn mailing list