Changeset 64eeb06 for libcfa/src/enum.hfa
- Timestamp:
- Jul 2, 2024, 2:27:57 PM (5 days ago)
- Branches:
- master
- Children:
- 72abc90a
- Parents:
- 011c29e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/enum.hfa
r011c29e r64eeb06 8 8 }; 9 9 10 forall( E | Bounded( E) ) trait Serial {10 forall( E | Bounded( E ) ) trait Serial { 11 11 unsigned fromInstance( E e ); 12 12 E fromInt( unsigned i ); … … 16 16 17 17 // Design one 18 forall( E, V | Serial( E) ) trait CfaEnum {18 forall( E, V | Serial( E ) ) trait CfaEnum { 19 19 char * label( E e ); 20 20 unsigned int posn( E e ); … … 24 24 // I/O 25 25 26 forall( ostype & | basic_ostream(ostype), E, V | CfaEnum(E, V) ) { 26 forall( istype & | istream( istype ), E, V | CfaEnum( E, V ) ) 27 istype & ?|?( istype &, E ); 28 29 forall( ostype & | ostream( ostype ), E, V | CfaEnum( E, V ) ) { 27 30 ostype & ?|?( ostype &, E ); 28 31 OSTYPE_VOID( E ); 29 32 } 30 33 31 forall( ostype & | basic_ostream(ostype), E | CfaEnum(E, quasi_void) ) 32 ostype & ?|?( ostype &, E ); 34 forall( ostype & | ostream( ostype ), E | CfaEnum( E, quasi_void ) ) { 35 ostype & ?|?( ostype &, E ); 36 OSTYPE_VOID( E ); 37 } 33 38 34 39 // Design two <- should go for this if we have change the cost model 35 // forall( E | Serial(E)) trait CfaEnum {36 // char * label( E e);37 // unsigned int posn( E e);40 // forall( E | Serial( E ) ) trait CfaEnum { 41 // char * label( E e ); 42 // unsigned int posn( E e ); 38 43 // }; 39 44 40 // forall( E, V| CfaEnum(E)) trait TypedEnum {41 // V value( E e);45 // forall( E, V| CfaEnum( E)) trait TypedEnum { 46 // V value( E e); 42 47 // }; 43 48 44 forall( E, V | CfaEnum( E, V) ) { // relational operators45 int ?==?( E, E);46 int ?!=?( E, E);47 int ?<?( E, E);48 int ?<=?( E, E);49 int ?>?( E, E);50 int ?>=?( E, E);49 forall( E, V | CfaEnum( E, V ) ) { // relational operators 50 int ?==?( E, E ); 51 int ?!=?( E, E ); 52 int ?<?( E, E ); 53 int ?<=?( E, E ); 54 int ?>?( E, E ); 55 int ?>=?( E, E ); 51 56 52 int ++?( E&);53 int ?++( E&);54 int --?( E&);55 int ?--( E&);57 int ++?( E &); 58 int ?++( E &); 59 int --?( E &); 60 int ?--( E &); 56 61 }
Note: See TracChangeset
for help on using the changeset viewer.