Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/collection.hfa

    raccc5dbb r58870e6b  
    11#pragma once
    2 #include <stdio.h> // REMOVE THIS AFTER DEBUGGING
    3 
    42
    53struct Colable {
    6         struct Colable * next;                                                                          // next node in the list
     4        Colable * next;                                                                         // next node in the list
    75        // invariant: (next != 0) <=> listed()
    86};
    9 #ifdef __cforall
    10 static inline {
     7
     8inline {
    119        // PUBLIC
    1210
     
    3028        }
    3129
    32         // // wrappers to make Collection have T
    33         // forall( dtype T ) {
    34         //      T *& Next( T * n ) {
    35         //              return (T *)Next( (Colable *)n );
    36         //      }
     30        // wrappers to make Collection have T
     31        forall( dtype T ) {
     32                T *& Next( T * n ) {
     33                        return (T *)Next( (Colable *)n );
     34                }
    3735
    38         //      bool listed( T * n ) {
    39         //              return Next( (Colable *)n ) != 0p;
    40         //      }
    41         // } // distribution
     36                bool listed( T * n ) {
     37                        return Next( (Colable *)n ) != 0p;
     38                }
     39        } // distribution
    4240} // distribution
    4341
     
    4745};
    4846
    49 static inline {
     47inline {
    5048        // class invariant: root == 0 & empty() | *root in *this
    5149        void ?{}( Collection &, const Collection & ) = void; // no copy
     
    7068};
    7169
    72 static inline {
     70inline {
    7371        void ?{}( ColIter & colIter ) with( colIter ) {
    7472                curr = 0p;
     
    8179        } // distribution
    8280} // distribution
    83 #endif
Note: See TracChangeset for help on using the changeset viewer.