Changeset 12bbb367


Ignore:
Timestamp:
Mar 9, 2018, 10:56:32 AM (6 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:
f86c8e5
Parents:
e59f0bf
git-author:
Aaron Moss <a3moss@…> (03/09/18 10:55:43)
git-committer:
Aaron Moss <a3moss@…> (03/09/18 10:56:32)
Message:

Formatting fixes to C++ code listing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/Paper.tex

    re59f0bf r12bbb367  
    29042904                T value;
    29052905                node * next;
    2906                 node( const T & v, node * n = nullptr ) : value( v), next( n) {}
     2906                node( const T & v, node * n = nullptr ) : value( v ), next( n ) {}
    29072907        };
    29082908        node * head;
     
    29152915                head = nullptr;
    29162916        }
    2917         void copy( const stack<T> & o) {
     2917        void copy( const stack<T> & o ) {
    29182918                node ** crnt = &head;
    2919                 for ( node * next = o.head;; next; next = next->next ) {
     2919                for ( node * next = o.head; next; next = next->next ) {
    29202920                        *crnt = new node{ next->value }; /***/
    29212921                        crnt = &(*crnt)->next;
     
    29242924        }
    29252925        stack() : head( nullptr) {}
    2926         stack( const stack<T> & o) { copy( o); }
    2927         stack( stack<T> && o) : head( o.head) { o.head = nullptr; }
     2926        stack( const stack<T> & o ) { copy( o ); }
     2927        stack( stack<T> && o ) : head( o.head) { o.head = nullptr; }
    29282928        ~stack() { clear(); }
    29292929        stack & operator= ( const stack<T> & o) {
    29302930                if ( this == &o ) return *this;
    29312931                clear();
    2932                 copy( o);
     2932                copy( o );
    29332933                return *this;
    29342934        }
    2935         stack & operator= ( stack<T> && o) {
     2935        stack & operator= ( stack<T> && o ) {
    29362936                if ( this == &o ) return *this;
    29372937                head = o.head;
     
    29402940        }
    29412941        bool empty() const { return head == nullptr; }
    2942         void push( const T & value) { head = new node{ value, head };  /***/ }
     2942        void push( const T & value ) { head = new node{ value, head };  /***/ }
    29432943        T pop() {
    29442944                node * n = head;
    29452945                head = n->next;
    2946                 T x = std::move( n->value);
     2946                T x = std::move( n->value );
    29472947                delete n;
    29482948                return x;
Note: See TracChangeset for help on using the changeset viewer.