Ignore:
Timestamp:
Dec 17, 2020, 4:18:23 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
089b1a9, f4f79dd
Parents:
c5a98f3 (diff), 68a867ee (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    rc5a98f3 r41cde266  
    11#pragma once
     2#include <stdio.h> // REMOVE THIS AFTER DEBUGGING
     3
    24
    35struct Colable {
    4         Colable * next;                                                                         // next node in the list
     6        struct Colable * next;                                                                          // next node in the list
    57        // invariant: (next != 0) <=> listed()
    68};
    7 
    8 inline {
     9#ifdef __cforall
     10static inline {
    911        // PUBLIC
    1012
     
    2830        }
    2931
    30         // wrappers to make Collection have T
    31         forall( dtype T ) {
    32                 T *& Next( T * n ) {
    33                         return (T *)Next( (Colable *)n );
    34                 }
    35 
    36                 bool listed( T * n ) {
    37                         return Next( (Colable *)n ) != 0p;
    38                 }
    39         } // distribution
     32        // // wrappers to make Collection have T
     33        // forall( dtype T ) {
     34        //      T *& Next( T * n ) {
     35        //              return (T *)Next( (Colable *)n );
     36        //      }
     37        // } // distribution
    4038} // distribution
    4139
     40forall( dtype T | { T *& Next ( T * ); } ) {
     41        bool listed( T * n ) {
     42                return Next( n ) != 0p;
     43        }
     44}
    4245
    4346struct Collection {
     
    4548};
    4649
    47 inline {
     50static inline {
    4851        // class invariant: root == 0 & empty() | *root in *this
    4952        void ?{}( Collection &, const Collection & ) = void; // no copy
     
    6871};
    6972
    70 inline {
     73static inline {
    7174        void ?{}( ColIter & colIter ) with( colIter ) {
    7275                curr = 0p;
     
    7982        } // distribution
    8083} // distribution
     84#endif
Note: See TracChangeset for help on using the changeset viewer.