Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3440

Show
Ignore:
Timestamp:
04/17/08 01:43:25 (8 months ago)
Author:
sean
Message:

Changed definition of isStaticArrayType. This closes #994

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/core/Traits.d

    r3151 r3440  
    136136 
    137137 
     138private template isStaticArrayTypeInst( T ) 
     139{ 
     140    const T isStaticArrayTypeInst = void; 
     141} 
     142 
     143 
    138144/** 
    139145 * Evaluates to true if T is a static array type. 
     
    141147template isStaticArrayType( T ) 
    142148{ 
    143     const bool isStaticArrayType = is( typeof(T.init)[(T).sizeof / typeof(T.init).sizeof] == T ); 
     149    const bool isStaticArrayType = is( typeof(T.length) ) && 
     150                                   !is( typeof(T) == typeof(T.init) ) && 
     151                                   is( T == typeof(T[0])[isStaticArrayTypeInst!(T).length] ); 
    144152} 
    145153