Changes in doc/papers/general/Paper.tex [4c80a75:aa5fdac]
- File:
-
- 1 edited
-
doc/papers/general/Paper.tex (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
r4c80a75 raa5fdac 2875 2875 } 2876 2876 _Bool stack_empty( const stack * s ) { 2877 return s->head == NULL;2877 return s->head == NULL; 2878 2878 } 2879 2879 void push_stack( stack * s, void * v ) { 2880 node * n = malloc( sizeof(node)); /***/2880 node * n = malloc(sizeof(node)); /***/ 2881 2881 *n = (node){ v, s->head }; /***/ 2882 2882 s->head = n; … … 2908 2908 }; 2909 2909 struct stack { node(T) * head; }; 2910 void ?{}( stack(T) & s, stack(T) t ) { // copy 2910 void ?{}( stack(T) & s ) { (s.head){ 0 }; } 2911 void ?{}( stack(T) & s, stack(T) t ) { 2911 2912 node(T) ** cr = &s.head; 2912 2913 for ( node(T) * nx = t.head; nx; nx = nx->next ) { … … 2922 2923 nx = cr->next; 2923 2924 ^(*cr){}; 2924 free( cr);2925 free(cr); 2925 2926 } 2926 2927 head = 0; 2927 2928 } 2928 2929 2929 \end{cfa} 2930 2930 & 2931 2931 \begin{cfa}[xleftmargin=0pt,aboveskip=0pt,belowskip=0pt] 2932 void ?{}( stack(T) & s ) { (s.head){ 0 }; }2933 2932 void ^?{}( stack(T) & s) { clear( s ); } 2934 2933 stack(T) ?=?( stack(T) & s, stack(T) t ) { … … 2955 2954 } 2956 2955 } 2956 2957 2957 \end{cfa} 2958 2958 \end{tabular} … … 3003 3003 return *this; 3004 3004 } 3005 bool empty() const { 3006 return head == nullptr; 3007 } 3005 bool empty() const { return head == nullptr; } 3008 3006 void push( const T & value ) { 3009 3007 head = new node{ value, head }; /***/ … … 3017 3015 } 3018 3016 }; 3017 3018 3019 3019 3020 3020 \end{cfa} … … 3066 3066 return *this; 3067 3067 } 3068 bool empty() const { 3069 return head == nullptr; 3070 } 3068 bool empty() const { return head == nullptr; } 3071 3069 void push( const object & value ) { 3072 3070 head = new node{ value, head }; /***/ … … 3081 3079 }; 3082 3080 3081 3082 3083 3083 \end{cfa} 3084 3084 \end{tabular}
Note:
See TracChangeset
for help on using the changeset viewer.