Changes in libcfa/src/bits/collection.hfa [9536761:58870e6b]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/collection.hfa
r9536761 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 T 33 // forall( dtype T ) { 34 // T *& Next( T * n ) { 35 // return (T *)Next( (Colable *)n ); 36 // } 37 // } // distribution 30 // wrappers to make Collection have T 31 forall( dtype T ) { 32 T *& Next( T * n ) { 33 return (T *)Next( (Colable *)n ); 34 } 35 36 bool listed( T * n ) { 37 return Next( (Colable *)n ) != 0p; 38 } 39 } // distribution 38 40 } // distribution 39 41 40 forall( dtype T | { T *& Next ( T * ); } ) {41 bool listed( T * n ) {42 return Next( n ) != 0p;43 }44 }45 42 46 43 struct Collection { … … 48 45 }; 49 46 50 staticinline {47 inline { 51 48 // class invariant: root == 0 & empty() | *root in *this 52 49 void ?{}( Collection &, const Collection & ) = void; // no copy … … 68 65 69 66 struct ColIter { 70 void * curr; // element returned by |67 void * curr; // element to be returned by >> 71 68 }; 72 69 73 staticinline {70 inline { 74 71 void ?{}( ColIter & colIter ) with( colIter ) { 75 72 curr = 0p; … … 82 79 } // distribution 83 80 } // distribution 84 #endif
Note: See TracChangeset
for help on using the changeset viewer.