Understanding isInfinite(Range)

Philippe Sigaud philippe.sigaud at gmail.com
Mon Sep 6 11:53:27 PDT 2010


On Mon, Sep 6, 2010 at 18:47, Pelle <pelle.mansson at gmail.com> wrote:

> On 09/04/2010 02:11 PM, Simen kjaeraas wrote:
>
>> Is there a way you could write an isStatic(expr) template? Using
>>>
>>
>> template isStatic( alias T ) {
>> enum isStatic = is( char[1+T] );
>> }
>>
>> unittest {
>> int n = 3;
>> assert( !isStatic!n );
>> assert( isStatic!1 );
>> enum r = 5;
>> assert( isStatic!r );
>> }
>>
>
> enum s = "Hello";
>
> assert (isStatic!s);
>
> Gonna need more work than that.
>

Why? That's exactly the behavior we want, or so it seems to me.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20100906/ebb985c3/attachment.html>


More information about the Digitalmars-d-learn mailing list