home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / msdos / pascal / rehack / general / general.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-09  |  880 b   |  34 lines

  1. //---------------------------------------------------------------------------
  2. //
  3. //     File:           GENERAL.HPP
  4. //     Path:           ...\REHACK\GENERAL\GENERAL.HPP
  5. //     Version:                1.01
  6. //     Author:         Bob Provencher/GD SL
  7. //     CIS Id:         71621,2632
  8. //     Created On:     6/12/93
  9. //     Modified On:    6/22/93
  10. //     Description:    General function definitions for Rehack.
  11. //     Tabs:           5
  12. //
  13. //---------------------------------------------------------------------------
  14.  
  15. #ifndef _GENERAL_HPP
  16. #define _GENERAL_HPP
  17.  
  18. template <class T> const T& min( const T& a, const T& b )
  19. {
  20.         return a < b ? a : b;
  21. }
  22.  
  23. template <class T> const T& max( const T& a, const T& b )
  24. {
  25.         return a > b ? a : b;
  26. }
  27.  
  28. inline bool xor( const bool a, const bool b )
  29. {
  30.     return bool( ( a || b ) && !( a && b ) );
  31. }
  32.  
  33. #endif
  34.