Changeset ac4dad2 for doc/papers/general/evaluation/cpp-vstack.cpp
- Timestamp:
- Apr 28, 2018, 9:20:28 AM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
- Children:
- 6926a6d
- Parents:
- aa5fdac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/evaluation/cpp-vstack.cpp
raa5fdac rac4dad2 5 5 6 6 void stack::clear() { 7 for ( node * n ext = head; next; ) {8 node * cr nt = next;9 n ext = crnt->next;10 delete cr nt;7 for ( node * nx = head; nx; ) { 8 node * cr = nx; 9 nx = cr->next; 10 delete cr; 11 11 } 12 12 head = nullptr; … … 14 14 15 15 void stack::copy( const stack & o ) { 16 node ** cr nt= &head;17 for ( node * n ext = o.head; next; next = next->next ) {18 *cr nt = new node{ *next->value }; /***/19 cr nt = &(*crnt)->next;16 node ** cr = &head; 17 for ( node * nx = o.head; nx; nx = nx->next ) { 18 *cr = new node{ *nx->value }; /***/ 19 cr = &(*cr)->next; 20 20 } 21 *cr nt= nullptr;21 *cr = nullptr; 22 22 } 23 23
Note: See TracChangeset
for help on using the changeset viewer.