1 | /* Boost interval/compare/set.hpp template implementation file |
---|
2 | * |
---|
3 | * Copyright 2002-2003 Guillaume Melquiond |
---|
4 | * |
---|
5 | * Distributed under the Boost Software License, Version 1.0. |
---|
6 | * (See accompanying file LICENSE_1_0.txt or |
---|
7 | * copy at http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP |
---|
11 | #define BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP |
---|
12 | |
---|
13 | #include <boost/numeric/interval/detail/interval_prototype.hpp> |
---|
14 | #include <boost/numeric/interval/detail/test_input.hpp> |
---|
15 | #include <boost/numeric/interval/utility.hpp> |
---|
16 | |
---|
17 | namespace boost { |
---|
18 | namespace numeric { |
---|
19 | namespace interval_lib { |
---|
20 | namespace compare { |
---|
21 | namespace set { |
---|
22 | |
---|
23 | template<class T, class Policies1, class Policies2> inline |
---|
24 | bool operator<(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
25 | { |
---|
26 | return proper_subset(x, y); |
---|
27 | } |
---|
28 | |
---|
29 | template<class T, class Policies> inline |
---|
30 | bool operator<(const interval<T, Policies>& x, const T& y) |
---|
31 | { |
---|
32 | throw comparison_error(); |
---|
33 | } |
---|
34 | |
---|
35 | template<class T, class Policies1, class Policies2> inline |
---|
36 | bool operator<=(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
37 | { |
---|
38 | return subset(x, y); |
---|
39 | } |
---|
40 | |
---|
41 | template<class T, class Policies> inline |
---|
42 | bool operator<=(const interval<T, Policies>& x, const T& y) |
---|
43 | { |
---|
44 | throw comparison_error(); |
---|
45 | } |
---|
46 | |
---|
47 | template<class T, class Policies1, class Policies2> inline |
---|
48 | bool operator>(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
49 | { |
---|
50 | return proper_subset(y, x); |
---|
51 | } |
---|
52 | |
---|
53 | template<class T, class Policies> inline |
---|
54 | bool operator>(const interval<T, Policies>& x, const T& y) |
---|
55 | { |
---|
56 | throw comparison_error(); |
---|
57 | } |
---|
58 | |
---|
59 | template<class T, class Policies1, class Policies2> inline |
---|
60 | bool operator>=(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
61 | { |
---|
62 | return subset(y, x); |
---|
63 | } |
---|
64 | |
---|
65 | template<class T, class Policies> inline |
---|
66 | bool operator>=(const interval<T, Policies>& x, const T& y) |
---|
67 | { |
---|
68 | throw comparison_error(); |
---|
69 | } |
---|
70 | |
---|
71 | template<class T, class Policies1, class Policies2> inline |
---|
72 | bool operator==(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
73 | { |
---|
74 | return equal(y, x); |
---|
75 | } |
---|
76 | |
---|
77 | template<class T, class Policies> inline |
---|
78 | bool operator==(const interval<T, Policies>& x, const T& y) |
---|
79 | { |
---|
80 | throw comparison_error(); |
---|
81 | } |
---|
82 | |
---|
83 | template<class T, class Policies1, class Policies2> inline |
---|
84 | bool operator!=(const interval<T, Policies1>& x, const interval<T, Policies2>& y) |
---|
85 | { |
---|
86 | return !equal(y, x); |
---|
87 | } |
---|
88 | |
---|
89 | template<class T, class Policies> inline |
---|
90 | bool operator!=(const interval<T, Policies>& x, const T& y) |
---|
91 | { |
---|
92 | throw comparison_error(); |
---|
93 | } |
---|
94 | |
---|
95 | } // namespace set |
---|
96 | } // namespace compare |
---|
97 | } // namespace interval_lib |
---|
98 | } // namespace numeric |
---|
99 | } // namespace boost |
---|
100 | |
---|
101 | #endif // BOOST_NUMERIC_INTERVAL_COMPARE_SET_HPP |
---|