source: NonGTP/Boost/boost/spirit/fusion/sequence/detail/sequence_not_equal_to.hpp @ 857

Revision 857, 2.0 KB checked in by igarcia, 19 years ago (diff)
Line 
1/*=============================================================================
2    Copyright (c) 1999-2003 Jaakko Järvi
3    Copyright (c) 2001-2003 Joel de Guzman
4    Copyright (c) 2004 Peder Holt
5
6    Use, modification and distribution is subject to the Boost Software
7    License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8    http://www.boost.org/LICENSE_1_0.txt)
9==============================================================================*/
10#if !defined(FUSION_SEQUENCE_DETAIL_SEQUENCE_NOT_EQUAL_TO_HPP)
11#define FUSION_SEQUENCE_DETAIL_SEQUENCE_NOT_EQUAL_TO_HPP
12
13#include <boost/mpl/bool.hpp>
14#include <boost/static_assert.hpp>
15#include <boost/spirit/fusion/iterator/deref.hpp>
16#include <boost/spirit/fusion/iterator/next.hpp>
17#include <boost/spirit/fusion/iterator/equal_to.hpp>
18
19namespace boost { namespace fusion { namespace detail
20{
21    namespace sequence_not_equal_to_detail {
22        template <typename T,typename I1, typename I2>
23        bool call(T const& self,I1 const& a, I2 const& b) {
24            return *a != *b
25                || T::call(fusion::next(a), fusion::next(b));
26        }
27    }
28    template <typename Seq1, typename Seq2>
29    struct sequence_not_equal_to
30    {
31        typedef typename meta::end<Seq1>::type end1_type;
32        typedef typename meta::end<Seq2>::type end2_type;
33
34        template <typename I1, typename I2>
35        static bool
36        call(I1 const& a, I2 const& b)
37        {
38            typename meta::equal_to<I1, end1_type>::type eq;
39            return call(a, b, eq);
40        }
41
42        template <typename I1, typename I2>
43        static bool
44        call(I1 const&, I2 const&, mpl::true_)
45        {
46            BOOST_STATIC_ASSERT((meta::equal_to<I2, end2_type>::value));
47            return false;
48        }
49
50        template <typename I1, typename I2>
51        static bool
52        call(I1 const& a, I2 const& b, mpl::false_)
53        {
54            return sequence_not_equal_to_detail::call(sequence_not_equal_to<Seq1,Seq2>(),a,b);
55        }
56    };
57}}}
58
59#endif
Note: See TracBrowser for help on using the repository browser.