Changeset c87cd93 for doc/generic_types/evaluation/cpp-vstack.cpp
- Timestamp:
- Apr 17, 2017, 3:47:07 PM (6 years ago)
- Branches:
- aaron-thesis, arm-eh, 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-vstack.cpp
r33e22da rc87cd93 2 2 #include <utility> 3 3 4 stack::node::node( const object& v ) : value( v.new_copy() ), next( nullptr ) {} 5 stack::node::node( ptr<object>&& v, node* n ) : value( std::move(v) ), next( n ) {} 4 stack::node::node( const object& v, node* n ) : value( v.new_copy() ), next( n ) {} 6 5 7 6 void stack::copy(const stack& o) { … … 48 47 bool stack::empty() const { return head == nullptr; } 49 48 50 void stack::push( ptr<object>&& value) { head = new node{ std::move(value), head }; /***/ }49 void stack::push(const object& value) { head = new node{ value, head }; /***/ } 51 50 52 51 ptr<object> stack::pop() {
Note: See TracChangeset
for help on using the changeset viewer.