Changes in libcfa/src/containers/array.hfa [6e50a6b:63f42a8]
- File:
-
- 1 edited
-
libcfa/src/containers/array.hfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/array.hfa
r6e50a6b r63f42a8 1 1 2 2 3 forall( __CFA_tysys_id_only_X & ) struct tag {}; 3 // a type whose size is n 4 #define Z(n) char[n] 5 6 // the inverse of Z(-) 7 #define z(N) sizeof(N) 8 9 forall( T & ) struct tag {}; 4 10 #define ttag(T) ((tag(T)){}) 5 #define ztag(n) ttag( n)11 #define ztag(n) ttag(Z(n)) 6 12 7 13 … … 12 18 forall( [N], S & | sized(S), Timmed &, Tbase & ) { 13 19 struct arpk { 14 S strides[ N];20 S strides[z(N)]; 15 21 }; 16 22 … … 50 56 51 57 static inline size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) { 52 return N;58 return z(N); 53 59 } 54 60 55 61 // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa) 56 62 static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) { 57 void ?{}( S (&inner)[ N] ) {}63 void ?{}( S (&inner)[z(N)] ) {} 58 64 ?{}(this.strides); 59 65 } 60 66 static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) { 61 void ^?{}( S (&inner)[ N] ) {}67 void ^?{}( S (&inner)[z(N)] ) {} 62 68 ^?{}(this.strides); 63 69 }
Note:
See TracChangeset
for help on using the changeset viewer.