- File:
-
- 1 edited
-
doc/papers/general/evaluation/cpp-stack.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cpp-stack.hpp
r860f19f rac4dad2 14 14 15 15 void clear() { 16 for ( node * n ext = head; next; ) {17 node * cr nt = next;18 n ext = crnt->next;19 delete cr nt;16 for ( node * nx = head; nx; ) { 17 node * cr = nx; 18 nx = cr->next; 19 delete cr; 20 20 } 21 21 head = nullptr; … … 23 23 24 24 void copy( const stack<T> & o ) { 25 node ** cr nt= &head;26 for ( node * n ext = o.head; next; next = next->next ) {27 *cr nt = new node{ next->value }; /***/28 cr nt = &(*crnt)->next;25 node ** cr = &head; 26 for ( node * nx = o.head; nx; nx = nx->next ) { 27 *cr = new node{ nx->value }; /***/ 28 cr = &(*cr)->next; 29 29 } 30 *cr nt= nullptr;30 *cr = nullptr; 31 31 } 32 32
Note:
See TracChangeset
for help on using the changeset viewer.