]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/sequence/comparison/detail/not_equal_to.hpp
Added error detection for cases such as a read's two mates having different names...
[rsem.git] / boost / fusion / sequence / comparison / detail / not_equal_to.hpp
1 /*=============================================================================
2     Copyright (c) 1999-2003 Jaakko Jarvi
3     Copyright (c) 2001-2011 Joel de Guzman
4
5     Distributed under the Boost Software License, Version 1.0. (See accompanying 
6     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(FUSION_NOT_EQUAL_TO_05052005_1141)
9 #define FUSION_NOT_EQUAL_TO_05052005_1141
10
11 #include <boost/mpl/bool.hpp>
12 #include <boost/fusion/iterator/deref.hpp>
13 #include <boost/fusion/iterator/next.hpp>
14 #include <boost/fusion/iterator/equal_to.hpp>
15 #include <boost/fusion/support/as_const.hpp>
16
17 namespace boost { namespace fusion { namespace detail
18 {
19     template <typename Seq1, typename Seq2, bool same_size>
20     struct sequence_not_equal_to
21     {
22         typedef typename result_of::end<Seq1>::type end1_type;
23         typedef typename result_of::end<Seq2>::type end2_type;
24
25         template <typename I1, typename I2>
26         static bool
27         call(I1 const&, I2 const&, mpl::true_)
28         {
29             return false;
30         }
31
32         template <typename I1, typename I2>
33         static bool
34         call(I1 const& a, I2 const& b, mpl::false_)
35         {
36             return extension::as_const(*a) != extension::as_const(*b)
37                 || call(fusion::next(a), fusion::next(b));
38         }
39
40         template <typename I1, typename I2>
41         static bool
42         call(I1 const& a, I2 const& b)
43         {
44             typename result_of::equal_to<I1, end1_type>::type eq;
45             return call(a, b, eq);
46         }
47     };
48
49     template <typename Seq1, typename Seq2>
50     struct sequence_not_equal_to<Seq1, Seq2, false>
51     {
52         template <typename I1, typename I2>
53         static bool
54         call(I1 const& a, I2 const& b)
55         {
56             return true;
57         }
58     };
59 }}}
60
61 #endif