home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / cm / cmdefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-06  |  991 b   |  41 lines

  1. // CmDefs.h
  2. // -----------------------------------------------------------------
  3. // Compendium - C++ Container Class Library
  4. // Copyright (C) 1992-1994, Glenn M. Poorman, All rights reserved
  5. // -----------------------------------------------------------------
  6. // Definitions used throughout the Compendium library.
  7. // -----------------------------------------------------------------
  8.  
  9. #ifndef _CMDEFS_H
  10. #define _CMDEFS_H
  11.  
  12. #ifndef NULL
  13. #define NULL 0
  14. #endif
  15.  
  16. #ifndef FALSE
  17. #define FALSE 0
  18. #endif
  19.  
  20. #ifndef TRUE
  21. #define TRUE 1
  22. #endif
  23.  
  24. #ifndef Bool
  25. #define Bool int
  26. #endif
  27.  
  28. // "CmAbs" absolute value template function.
  29. template<class T> T CmAbs(const T& data)
  30. { return (data >= 0) ? data : -data; }
  31.  
  32. // "CmMax" maximum value template function.
  33. template<class T> T CmMax(const T& a, const T& b)
  34. { return (a >= b) ? a : b; }
  35.  
  36. // "CmMin" minimum value template function.
  37. template<class T> T CmMin(const T& a, const T& b)
  38. { return (a <= b) ? a : b; }
  39.  
  40. #endif
  41.