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