ThrowCompare.h

00001 /***********************************************************************************
00002         ThrowCompare.h
00003         
00004                 Interface for the ThrowCompare class
00005                 
00006  * Copyright (c) 1997
00007  * Mark of the Unicorn, Inc.
00008  *
00009  * Permission to use, copy, modify, distribute and sell this software
00010  * and its documentation for any purpose is hereby granted without fee,
00011  * provided that the above copyright notice appear in all copies and
00012  * that both that copyright notice and this permission notice appear
00013  * in supporting documentation.  Mark of the Unicorn makes no
00014  * representations about the suitability of this software for any
00015  * purpose.  It is provided "as is" without express or implied warranty.
00016                                 
00017 ***********************************************************************************/
00018 #ifndef ThrowCompare_H_
00019 #define ThrowCompare_H_
00020 
00021 # include "Prefix.h"
00022 # include "TestClass.h"
00023 
00024 struct ThrowCompare
00025 {
00026         bool operator()( const TestClass& a, const TestClass& b ) const {
00027           simulate_possible_failure();
00028           return a < b;
00029         }
00030 };
00031 
00032 
00033 struct ThrowEqual
00034 {
00035         inline bool operator()( const TestClass& a, const TestClass& b ) const
00036         {
00037                 simulate_possible_failure();
00038                 return a == b;
00039         }
00040 };
00041 
00042 struct ThrowHash // : private ThrowCompare
00043 {
00044         inline EH_CSTD::size_t operator()( const TestClass& a ) const
00045         {
00046                 simulate_possible_failure();
00047                 return EH_CSTD::size_t(a.value());
00048         }
00049 };
00050 
00051 #endif // ThrowCompare_H_

Generated on Mon Jun 5 10:20:48 2006 for Intelligence.kdevelop by  doxygen 1.4.6