home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / test / eh / ThrowCompare.h < prev    next >
C/C++ Source or Header  |  2000-12-07  |  1KB  |  52 lines

  1. /***********************************************************************************
  2.     ThrowCompare.h
  3.     
  4.         Interface for the ThrowCompare class
  5.         
  6.  * Copyright (c) 1997
  7.  * Mark of the Unicorn, Inc.
  8.  *
  9.  * Permission to use, copy, modify, distribute and sell this software
  10.  * and its documentation for any purpose is hereby granted without fee,
  11.  * provided that the above copyright notice appear in all copies and
  12.  * that both that copyright notice and this permission notice appear
  13.  * in supporting documentation.  Mark of the Unicorn makes no
  14.  * representations about the suitability of this software for any
  15.  * purpose.  It is provided "as is" without express or implied warranty.
  16.                 
  17. ***********************************************************************************/
  18. #ifndef ThrowCompare_H_
  19. #define ThrowCompare_H_
  20.  
  21. # include "Prefix.h"
  22. # include "TestClass.h"
  23.  
  24. struct ThrowCompare
  25. {
  26.     bool operator()( const TestClass& a, const TestClass& b ) const {
  27.       simulate_possible_failure();
  28.       return a < b;
  29.     }
  30. };
  31.  
  32.  
  33. struct ThrowEqual
  34. {
  35.     inline bool operator()( const TestClass& a, const TestClass& b ) const
  36.     {
  37.         simulate_possible_failure();
  38.         return a == b;
  39.     }
  40. };
  41.  
  42. struct ThrowHash // : private ThrowCompare
  43. {
  44.     inline EH_CSTD::size_t operator()( const TestClass& a ) const
  45.     {
  46.         simulate_possible_failure();
  47.         return EH_CSTD::size_t(a.value());
  48.     }
  49. };
  50.  
  51. #endif // ThrowCompare_H_
  52.