Changeset 3734
- Timestamp:
- 07/09/08 13:40:34 (5 months ago)
- Files:
-
- branches/next/0.99.7/tango/core/Traits.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/next/0.99.7/tango/core/Traits.d
r3690 r3734 173 173 } 174 174 175 176 private template isStaticArrayTypeInst( T )177 {178 const T isStaticArrayTypeInst = void;179 }180 181 182 175 /** 183 176 * Evaluates to true if T is a static array type. 184 177 */ 185 template isStaticArrayType( T ) 186 { 187 static if( is( typeof(T.length) ) && !is( typeof(T) == typeof(T.init) ) ) 188 { 189 const bool isStaticArrayType = is( T == typeof(T[0])[isStaticArrayTypeInst!(T).length] ); 178 template isStaticArrayType(T : T[U], size_t U) 179 { 180 const bool isStaticArrayType = true; 181 } 182 183 template isStaticArrayType(T) 184 { 185 const bool isStaticArrayType = false; 186 } 187 188 debug (UnitTest) { 189 190 unittest { 191 assert(isStaticArrayType!(char[15])); 192 assert(!isStaticArrayType!(char[])); 193 194 assert(isDynamicArrayType!(char[])); 195 assert(!isDynamicArrayType!(char[15])); 190 196 } 191 else 192 { 193 const bool isStaticArrayType = false; 194 } 195 } 196 197 } 197 198 198 199 /**












