1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/genericopenlibs/cppstdlib/stl/test/eh/ThrowCompare.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,46 @@
1.4 +/***********************************************************************************
1.5 + ThrowCompare.h
1.6 +
1.7 + Interface for the ThrowCompare class
1.8 +
1.9 + * Copyright (c) 1997
1.10 + * Mark of the Unicorn, Inc.
1.11 + *
1.12 + * Permission to use, copy, modify, distribute and sell this software
1.13 + * and its documentation for any purpose is hereby granted without fee,
1.14 + * provided that the above copyright notice appear in all copies and
1.15 + * that both that copyright notice and this permission notice appear
1.16 + * in supporting documentation. Mark of the Unicorn makes no
1.17 + * representations about the suitability of this software for any
1.18 + * purpose. It is provided "as is" without express or implied warranty.
1.19 +
1.20 +***********************************************************************************/
1.21 +#ifndef ThrowCompare_H_
1.22 +#define ThrowCompare_H_
1.23 +
1.24 +#include "Prefix.h"
1.25 +#include "TestClass.h"
1.26 +
1.27 +struct ThrowCompare {
1.28 + bool operator()( const TestClass& a, const TestClass& b ) const {
1.29 + simulate_possible_failure();
1.30 + return a < b;
1.31 + }
1.32 +};
1.33 +
1.34 +
1.35 +struct ThrowEqual {
1.36 + inline bool operator()( const TestClass& a, const TestClass& b ) const {
1.37 + simulate_possible_failure();
1.38 + return a == b;
1.39 + }
1.40 +};
1.41 +
1.42 +struct ThrowHash { // : private ThrowCompare
1.43 + inline EH_CSTD::size_t operator()( const TestClass& a ) const {
1.44 + simulate_possible_failure();
1.45 + return EH_CSTD::size_t(a.value());
1.46 + }
1.47 +};
1.48 +
1.49 +#endif // ThrowCompare_H_