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_EQUAL_TO_05052005_1142)
|
Chris@16
|
9 #define FUSION_EQUAL_TO_05052005_1142
|
Chris@16
|
10
|
Chris@101
|
11 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
12 #include <boost/mpl/bool.hpp>
|
Chris@16
|
13 #include <boost/fusion/iterator/deref.hpp>
|
Chris@16
|
14 #include <boost/fusion/iterator/next.hpp>
|
Chris@16
|
15 #include <boost/fusion/iterator/equal_to.hpp>
|
Chris@16
|
16 #include <boost/fusion/support/as_const.hpp>
|
Chris@16
|
17
|
Chris@16
|
18 namespace boost { namespace fusion { namespace detail
|
Chris@16
|
19 {
|
Chris@16
|
20 template <typename Seq1, typename Seq2, bool same_size>
|
Chris@16
|
21 struct sequence_equal_to
|
Chris@16
|
22 {
|
Chris@16
|
23 typedef typename result_of::end<Seq1>::type end1_type;
|
Chris@16
|
24 typedef typename result_of::end<Seq2>::type end2_type;
|
Chris@16
|
25
|
Chris@16
|
26 template <typename I1, typename I2>
|
Chris@101
|
27 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
28 static bool
|
Chris@16
|
29 call(I1 const&, I2 const&, mpl::true_)
|
Chris@16
|
30 {
|
Chris@16
|
31 return true;
|
Chris@16
|
32 }
|
Chris@16
|
33
|
Chris@16
|
34 template <typename I1, typename I2>
|
Chris@101
|
35 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
36 static bool
|
Chris@16
|
37 call(I1 const& a, I2 const& b, mpl::false_)
|
Chris@16
|
38 {
|
Chris@16
|
39 return extension::as_const(*a) == extension::as_const(*b)
|
Chris@16
|
40 && call(fusion::next(a), fusion::next(b));
|
Chris@16
|
41 }
|
Chris@16
|
42
|
Chris@16
|
43 template <typename I1, typename I2>
|
Chris@101
|
44 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
45 static bool
|
Chris@16
|
46 call(I1 const& a, I2 const& b)
|
Chris@16
|
47 {
|
Chris@16
|
48 typename result_of::equal_to<I1, end1_type>::type eq;
|
Chris@16
|
49 return call(a, b, eq);
|
Chris@16
|
50 }
|
Chris@16
|
51 };
|
Chris@16
|
52
|
Chris@16
|
53 template <typename Seq1, typename Seq2>
|
Chris@16
|
54 struct sequence_equal_to<Seq1, Seq2, false>
|
Chris@16
|
55 {
|
Chris@16
|
56 template <typename I1, typename I2>
|
Chris@101
|
57 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
58 static bool
|
Chris@16
|
59 call(I1 const& /*a*/, I2 const& /*b*/)
|
Chris@16
|
60 {
|
Chris@16
|
61 return false;
|
Chris@16
|
62 }
|
Chris@16
|
63 };
|
Chris@16
|
64 }}}
|
Chris@16
|
65
|
Chris@16
|
66 #endif
|