Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/containers/array.hfa

    r6e50a6b r63f42a8  
    11
    22
    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
     9forall( T & ) struct tag {};
    410#define ttag(T) ((tag(T)){})
    5 #define ztag(n) ttag(n)
     11#define ztag(n) ttag(Z(n))
    612
    713
     
    1218forall( [N], S & | sized(S), Timmed &, Tbase & ) {
    1319    struct arpk {
    14         S strides[N];
     20        S strides[z(N)];
    1521    };
    1622
     
    5056
    5157    static inline size_t ?`len( arpk(N, S, Timmed, Tbase) & a ) {
    52         return N;
     58        return z(N);
    5359    }
    5460
    5561    // workaround #226 (and array relevance thereof demonstrated in mike102/otype-slow-ndims.cfa)
    5662    static inline void ?{}( arpk(N, S, Timmed, Tbase) & this ) {
    57         void ?{}( S (&inner)[N] ) {}
     63        void ?{}( S (&inner)[z(N)] ) {}
    5864        ?{}(this.strides);
    5965    }
    6066    static inline void ^?{}( arpk(N, S, Timmed, Tbase) & this ) {
    61         void ^?{}( S (&inner)[N] ) {}
     67        void ^?{}( S (&inner)[z(N)] ) {}
    6268        ^?{}(this.strides);
    6369    }
Note: See TracChangeset for help on using the changeset viewer.