Ignore:
Timestamp:
Apr 15, 2017, 7:09:59 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:
c57d1935
Parents:
308880c
Message:

Minor cleanup, also filled in benchmark source appendix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/cpp-stack.hpp

    r308880c ra381b46  
    11#pragma once
    2 
    32#include <utility>
    43
     
    1110                node( T&& v, node* n ) : value(std::move(v)), next(n) {}
    1211        };
    13        
    1412        node* head;
    1513
     
    2422                *crnt = nullptr;
    2523        }
    26 
    2724public:
    2825        void clear() {
     
    3734
    3835        stack() : head(nullptr) {}
    39 
    4036        stack(const stack<T>& o) { copy(o); }
    41 
    4237        stack(stack<T>&& o) : head(o.head) { o.head = nullptr; }
    43 
    4438        ~stack() { clear(); }
    4539
     
    5852        }
    5953
    60         bool empty() const {
    61                 return head == nullptr;
    62         }
     54        bool empty() const { return head == nullptr; }
    6355
    64         void push(T&& value) {
    65                 head = new node{ std::move(value), head };  /***/
    66         }
     56        void push(T&& value) { head = new node{ std::move(value), head };  /***/ }
    6757
    6858        T pop() {
Note: See TracChangeset for help on using the changeset viewer.