Ignore:
Timestamp:
Jun 19, 2024, 3:20:39 PM (2 weeks ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
57e43cd
Parents:
1725989
Message:
  1. Add count_e( enum_name ), a pseudo function that return the number of element in an enum; 2. Implementation of enum range loop.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/enum.cfa

    r1725989 r525f7ad  
    1313    return os | type_name(e) | "." | labelE(e);
    1414}
     15
     16forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) {
     17    int ?==?(E l, E r) { return posE(l) == posE(r); }
     18    int ?<=?(E l, E r) { return posE(l) <= posE(r); }
     19    int ?>=?(E l, E r) { return posE(l) >= posE(r); }
     20    int ?<?(E l, E r) { return posE(l) < posE(r); }
     21    int ?>?(E l, E r) { return posE(l) > posE(r); }
     22}
Note: See TracChangeset for help on using the changeset viewer.