Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 1999-2003 Jaakko Jarvi
|
Chris@16
|
3 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
4
|
Chris@16
|
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
7 ==============================================================================*/
|
Chris@16
|
8 #if !defined(FUSION_LESS_EQUAL_05052005_1141)
|
Chris@16
|
9 #define FUSION_LESS_EQUAL_05052005_1141
|
Chris@16
|
10
|
Chris@16
|
11 #include <boost/mpl/bool.hpp>
|
Chris@16
|
12 #include <boost/fusion/iterator/deref.hpp>
|
Chris@16
|
13 #include <boost/fusion/iterator/next.hpp>
|
Chris@16
|
14 #include <boost/fusion/iterator/equal_to.hpp>
|
Chris@16
|
15 #include <boost/fusion/support/as_const.hpp>
|
Chris@16
|
16
|
Chris@16
|
17 namespace boost { namespace fusion { namespace detail
|
Chris@16
|
18 {
|
Chris@16
|
19 template <typename Seq1, typename Seq2>
|
Chris@16
|
20 struct sequence_less_equal
|
Chris@16
|
21 {
|
Chris@16
|
22 typedef typename result_of::end<Seq1>::type end1_type;
|
Chris@16
|
23 typedef typename result_of::end<Seq2>::type end2_type;
|
Chris@16
|
24
|
Chris@16
|
25 template <typename I1, typename I2>
|
Chris@16
|
26 static bool
|
Chris@16
|
27 call(I1 const&, I2 const&, mpl::true_)
|
Chris@16
|
28 {
|
Chris@16
|
29 return true;
|
Chris@16
|
30 }
|
Chris@16
|
31
|
Chris@16
|
32 template <typename I1, typename I2>
|
Chris@16
|
33 static bool
|
Chris@16
|
34 call(I1 const& a, I2 const& b, mpl::false_)
|
Chris@16
|
35 {
|
Chris@16
|
36 return extension::as_const(*a) <= extension::as_const(*b)
|
Chris@16
|
37 && (!(extension::as_const(*b) <= extension::as_const(*a)) ||
|
Chris@16
|
38 call(fusion::next(a), fusion::next(b)));
|
Chris@16
|
39 }
|
Chris@16
|
40
|
Chris@16
|
41 template <typename I1, typename I2>
|
Chris@16
|
42 static bool
|
Chris@16
|
43 call(I1 const& a, I2 const& b)
|
Chris@16
|
44 {
|
Chris@16
|
45 typename result_of::equal_to<I1, end1_type>::type eq;
|
Chris@16
|
46 return call(a, b, eq);
|
Chris@16
|
47 }
|
Chris@16
|
48 };
|
Chris@16
|
49 }}}
|
Chris@16
|
50
|
Chris@16
|
51 #endif
|