Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/bits/stack.hfa

    r9536761 ra3a76ea  
    22
    33#include "bits/collection.hfa"
    4 
    5 // A Stack(T) is a Collection(T) defining the ordering that nodes are returned by drop() in the reverse order from those
    6 // added by add(). T must be a public descendant of uColable.
    7 
    8 // The implementation is a typical singly-linked list, except the next field of the last element points to itself
    9 // instead of being null.
    104
    115forall( dtype T | { T *& Next ( T * ); } ) {
     
    6458} // distribution
    6559
    66 // A StackIter(T) is a subclass of ColIter(T) that generates the elements of a Stack(T).  It returns the elements in the
    67 // order returned by drop().
    6860
    6961forall( dtype T | { T *& Next ( T * ); } ) {
     
    7769                } // post: curr == 0p
    7870
    79                 // create an iterator active in stack s
     71                // create an iterator active in Stack s
    8072                void ?{}( StackIter(T) & si, Stack(T) & s ) with( si ) {
    8173                        curr = &head( s );
     
    8678                } // post: curr = {e in s}
    8779
    88                 // make existing iterator active in stack s
     80                // make existing iterator active in Stack q
    8981                void over( StackIter(T) & si, Stack(T) & s ) with( si ) {
    9082                        curr = &head( s );
    9183                } // post: curr = {e in s}
    9284
    93                 bool ?|?( StackIter(T) & si, T && tp ) with( si ) {
     85                bool ?>>?( StackIter(T) & si, T && tp ) with( si ) {
    9486                        if ( curr ) {
    9587                                &tp = Curr( si );
Note: See TracChangeset for help on using the changeset viewer.