Ignore:
Timestamp:
Apr 14, 2017, 6:24:35 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
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:
17f27d40, 1c38f5b, 6eb4398
Parents:
4570131
Message:

Some compaction of benchmark code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-vstack.cpp

    r4570131 r79b8dc3  
    55stack::node::node( const object& v ) : value( v.new_copy() ), next( nullptr ) {}
    66
    7 stack::node::node( std::unique_ptr<object>&& v, node* n ) : value( std::move(v) ), next( n ) {}
     7stack::node::node( ptr<object>&& v, node* n ) : value( std::move(v) ), next( n ) {}
    88
    99void stack::copy(const stack& o) {
     
    5050}
    5151
    52 bool stack::empty() const {
    53         return head == nullptr;
    54 }
     52bool stack::empty() const { return head == nullptr; }
    5553
    56 void stack::push(std::unique_ptr<object>&& value) {
    57         head = new node{ std::move(value), head }; /***/
    58 }
     54void stack::push(ptr<object>&& value) { head = new node{ std::move(value), head }; /***/ }
    5955
    60 std::unique_ptr<object> stack::pop() {
     56ptr<object> stack::pop() {
    6157        node* n = head;
    6258        head = n->next;
    63         std::unique_ptr<object> x = std::move(n->value);
     59        ptr<object> x = std::move(n->value);
    6460        delete n;
    6561        return x;
Note: See TracChangeset for help on using the changeset viewer.