- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/collection.hfa
r58870e6b raccc5dbb 1 1 #pragma once 2 #include <stdio.h> // REMOVE THIS AFTER DEBUGGING 3 2 4 3 5 struct Colable { 4 Colable * next; // next node in the list6 struct Colable * next; // next node in the list 5 7 // invariant: (next != 0) <=> listed() 6 8 }; 7 8 inline {9 #ifdef __cforall 10 static inline { 9 11 // PUBLIC 10 12 … … 28 30 } 29 31 30 // wrappers to make Collection have T31 forall( dtype T ) {32 T *& Next( T * n ) {33 return (T *)Next( (Colable *)n );34 }32 // // wrappers to make Collection have T 33 // forall( dtype T ) { 34 // T *& Next( T * n ) { 35 // return (T *)Next( (Colable *)n ); 36 // } 35 37 36 bool listed( T * n ) {37 return Next( (Colable *)n ) != 0p;38 }39 } // distribution38 // bool listed( T * n ) { 39 // return Next( (Colable *)n ) != 0p; 40 // } 41 // } // distribution 40 42 } // distribution 41 43 … … 45 47 }; 46 48 47 inline {49 static inline { 48 50 // class invariant: root == 0 & empty() | *root in *this 49 51 void ?{}( Collection &, const Collection & ) = void; // no copy … … 68 70 }; 69 71 70 inline {72 static inline { 71 73 void ?{}( ColIter & colIter ) with( colIter ) { 72 74 curr = 0p; … … 79 81 } // distribution 80 82 } // distribution 83 #endif
Note: See TracChangeset
for help on using the changeset viewer.