home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sources / misc / 4250 / boolean.h next >
Encoding:
C/C++ Source or Header  |  1993-01-11  |  483 b   |  27 lines

  1. //$$ boolean.h                       Boolean class
  2.  
  3. #ifndef Boolean_LIB
  4. #define Boolean_LIB 0
  5.  
  6. class Boolean
  7. {
  8.    int value;
  9. public:
  10.    Boolean(const int b) { value = b ? 1 : 0; }
  11.    Boolean(const void* b) { value = b ? 1 : 0; }
  12.    Boolean() {}
  13.    operator int() const { return value; }
  14.    int operator!() const { return !value; }
  15.    FREE_CHECK(Boolean);
  16. };
  17.  
  18. #ifndef __GNUG__
  19.    const Boolean TRUE = 1;
  20.    const Boolean FALSE = 0;
  21. #else
  22. #define FALSE 0
  23. #define TRUE 1
  24. #endif
  25.  
  26. #endif
  27.