Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.hfa

    rbb336a6 r236f133  
    1515};
    1616
    17 // Design one
    18 forall( E, V | Serial( E ) ) trait CfaEnum {
     17forall( E | Serial( E ) ) trait CfaEnum {
    1918    const char * label( E e );
    2019    unsigned int posn( E e );
     20};
     21
     22forall( E, V | CfaEnum( E ) ) trait TypedEnum {
    2123    V value( E e );
    2224};
     
    2426// I/O
    2527
    26 forall( istype & | istream( istype ), E, V | CfaEnum( E, V ) )
     28forall( istype & | istream( istype ), E | CfaEnum( E ) )
    2729istype & ?|?( istype &, E & );
    2830
    29 forall( ostype & | ostream( ostype ), E, V | CfaEnum( E, V ) ) {
     31forall( ostype & | ostream( ostype ), E | CfaEnum( E ) ) {
    3032        ostype & ?|?( ostype &, E );
    3133        OSTYPE_VOID( E );
    3234}
    3335
    34 forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) {
    35         ostype & ?|?( ostype &, E );
    36         OSTYPE_VOID( E );
    37 }
     36// forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) {
     37//      ostype & ?|?( ostype &, E );
     38//      OSTYPE_VOID( E );
     39// }
    3840
    3941// Design two <- should go for this if we have change the cost model
     
    4850
    4951static inline
    50 forall( E, V | CfaEnum( E, V ) ) {
     52forall( E | CfaEnum( E ) ) {
    5153    int ?==?( E l, E r ) { return posn( l ) == posn( r ); }     // relational operators
    5254    int ?!=?( E l, E r ) { return posn( l ) != posn( r ); }
Note: See TracChangeset for help on using the changeset viewer.