source: libcfa/src/enum.cfa @ 343c8be

Last change on this file since 343c8be was 5eb3f65, checked in by Peter A. Buhr <pabuhr@…>, 13 days ago

change enumeration function names labelE, valueE, posE to label, value, posn

  • Property mode set to 100644
File size: 708 bytes
Line 
1#include "enum.hfa"
2#include "fstream.hfa"
3
4#pragma GCC visibility push(default)
5
6forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V))
7ostype & ?|?(ostype& os, E e) {
8    return os | type_name(e) | "." | label(e);
9}
10
11forall(ostype & | basic_ostream(ostype), E| CfaEnum(E, quasi_void))
12ostype & ?|?(ostype& os, E e) {
13    return os | type_name(e) | "." | label(e);
14}
15
16forall(ostype & | basic_ostream(ostype), E, V| CfaEnum(E, V)) {
17    int ?==?(E l, E r) { return posn(l) == posn(r); }
18    int ?<=?(E l, E r) { return posn(l) <= posn(r); }
19    int ?>=?(E l, E r) { return posn(l) >= posn(r); }
20    int ?<?(E l, E r) { return posn(l) < posn(r); }
21    int ?>?(E l, E r) { return posn(l) > posn(r); }
22}
Note: See TracBrowser for help on using the repository browser.