Changeset c87cd93 for doc/generic_types/evaluation/cpp-stack.hpp
- Timestamp:
- Apr 17, 2017, 3:47:07 PM (7 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, resolv-new, with_gc
- Children:
- 4ae83a4b
- Parents:
- 33e22da
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/generic_types/evaluation/cpp-stack.hpp
r33e22da rc87cd93 7 7 node* next; 8 8 9 node( T& v ) : value(v), next(nullptr) {} 10 node( T&& v, node* n ) : value(std::move(v)), next(n) {} 9 node( const T& v, node* n = nullptr ) : value(v), next(n) {} 11 10 }; 12 11 node* head; … … 54 53 bool empty() const { return head == nullptr; } 55 54 56 void push( T&& value) { head = new node{ std::move(value), head }; /***/ }55 void push(const T& value) { head = new node{ value, head }; /***/ } 57 56 58 57 T pop() {
Note: See TracChangeset
for help on using the changeset viewer.