home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / PROGRAM / C / NEWMAT / BOOLEAN.HXX next >
Text File  |  1993-12-01  |  459b  |  22 lines

  1. //$$ boolean.hxx                     Boolean class
  2.  
  3. #ifndef BOOL_LIB
  4. #define BOOL_LIB 0
  5.  
  6. class BOOL
  7. {
  8.    int value;
  9. public:
  10.    BOOL(int b) { value = b ? 1 : 0; }
  11.    BOOL(void* b) { value = b ? 1 : 0; }
  12.    BOOL() {}
  13.    operator int() const { return value; }
  14.    BOOL operator&&(const BOOL& b) const { return value && b.value; }
  15.    BOOL operator||(const BOOL& b) const { return value || b.value; }
  16. };
  17.  
  18. #define FALSE 0
  19. #define TRUE 1
  20.  
  21. #endif
  22.