1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2010-2010: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4    Distributed under the Boost Software License, Version 1.0.
5       (See accompanying file LICENCE.txt or copy at
6            http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 #ifndef BOOST_ICL_CONCEPT_COMPARABLE_HPP_JOFA_100921
9 #define BOOST_ICL_CONCEPT_COMPARABLE_HPP_JOFA_100921
10 
11 #include <boost/utility/enable_if.hpp>
12 #include <boost/icl/type_traits/is_icl_container.hpp>
13 
14 namespace boost{ namespace icl
15 {
16 
17 //==============================================================================
18 //= Equivalences and Orderings<Comparable>
19 //==============================================================================
20 template<class Type>
21 inline typename enable_if<is_icl_container<Type>, bool>::type
operator !=(const Type & left,const Type & right)22 operator != (const Type& left, const Type& right)
23 { return !(left == right); }
24 
25 template<class Type>
26 inline typename enable_if<is_icl_container<Type>, bool>::type
operator >(const Type & left,const Type & right)27 operator > (const Type& left, const Type& right)
28 { return right < left; }
29 
30 /** Partial ordering which is induced by Compare */
31 template<class Type>
32 inline typename enable_if<is_icl_container<Type>, bool>::type
operator <=(const Type & left,const Type & right)33 operator <= (const Type& left, const Type& right)
34 { return !(left > right); }
35 
36 template<class Type>
37 inline typename enable_if<is_icl_container<Type>, bool>::type
operator >=(const Type & left,const Type & right)38 operator >= (const Type& left, const Type& right)
39 { return !(left < right); }
40 
41 }} // namespace boost icl
42 
43 #endif
44 
45 
46