- File:
-
- 1 edited
-
doc/papers/general/evaluation/cpp-vstack.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cpp-vstack.cpp
rac4dad2 r860f19f 5 5 6 6 void stack::clear() { 7 for ( node * n x = head; nx; ) {8 node * cr = nx;9 n x = cr->next;10 delete cr ;7 for ( node * next = head; next; ) { 8 node * crnt = next; 9 next = crnt->next; 10 delete crnt; 11 11 } 12 12 head = nullptr; … … 14 14 15 15 void stack::copy( const stack & o ) { 16 node ** cr = &head;17 for ( node * n x = o.head; nx; nx = nx->next ) {18 *cr = new node{ *nx->value }; /***/19 cr = &(*cr)->next;16 node ** crnt = &head; 17 for ( node * next = o.head; next; next = next->next ) { 18 *crnt = new node{ *next->value }; /***/ 19 crnt = &(*crnt)->next; 20 20 } 21 *cr = nullptr;21 *crnt = nullptr; 22 22 } 23 23
Note:
See TracChangeset
for help on using the changeset viewer.