#pragma once forall( E ) trait Bounded { E lowerBound(); E upperBound(); }; forall( E | Bounded( E ) ) trait Serial { unsigned fromInstance( E e ); E fromInt( unsigned int posn ); E succ( E e ); E pred( E e ); }; forall( E, T ) trait TypedEnum { T valueE( E e ); char * labelE( E e ); unsigned int posE( E e ); }; forall( E, T | TypedEnum( E, T ) ) { // comparison int ?==?( E l, E r ); // true if l and r are same enumerators int ?!=?( E l, E r ); // true if l and r are different enumerators int ?!=?( E l, zero_t ); // true if l is not the first enumerator int ??( E l, E r ); // true if l is an enuemrator after r int ?>=?( E l, E r ); // true if l after or the same as r }