2 #ifndef BOOST_MPL_EQUAL_HPP_INCLUDED
\r
3 #define BOOST_MPL_EQUAL_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2000-2004
\r
7 // Distributed under the Boost Software License, Version 1.0.
\r
8 // (See accompanying file LICENSE_1_0.txt or copy at
\r
9 // http://www.boost.org/LICENSE_1_0.txt)
\r
11 // See http://www.boost.org/libs/mpl for documentation.
\r
13 // $Id: equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
14 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
15 // $Revision: 49267 $
\r
17 #include <boost/mpl/aux_/iter_fold_if_impl.hpp>
\r
18 #include <boost/mpl/aux_/iter_apply.hpp>
\r
19 #include <boost/mpl/and.hpp>
\r
20 #include <boost/mpl/not.hpp>
\r
21 #include <boost/mpl/begin_end.hpp>
\r
22 #include <boost/mpl/next.hpp>
\r
23 #include <boost/mpl/always.hpp>
\r
24 #include <boost/mpl/bool.hpp>
\r
25 #include <boost/mpl/lambda.hpp>
\r
26 #include <boost/mpl/bind.hpp>
\r
27 #include <boost/mpl/apply.hpp>
\r
28 #include <boost/mpl/void.hpp>
\r
29 #include <boost/mpl/aux_/na_spec.hpp>
\r
30 #include <boost/mpl/aux_/lambda_support.hpp>
\r
31 #include <boost/mpl/aux_/msvc_eti_base.hpp>
\r
33 #include <boost/type_traits/is_same.hpp>
\r
35 namespace boost { namespace mpl {
\r
41 , typename LastIterator1
\r
42 , typename LastIterator2
\r
48 , typename Iterator1
\r
52 typedef typename and_<
\r
53 not_< is_same<Iterator1,LastIterator1> >
\r
54 , not_< is_same<Iterator2,LastIterator2> >
\r
55 , aux::iter_apply2<Predicate,Iterator1,Iterator2>
\r
62 , typename Sequence2
\r
63 , typename Predicate
\r
67 typedef typename begin<Sequence1>::type first1_;
\r
68 typedef typename begin<Sequence2>::type first2_;
\r
69 typedef typename end<Sequence1>::type last1_;
\r
70 typedef typename end<Sequence2>::type last2_;
\r
72 typedef aux::iter_fold_if_impl<
\r
76 , protect< aux::equal_pred<Predicate,last1_,last2_> >
\r
81 typedef typename fold_::iterator iter1_;
\r
82 typedef typename fold_::state iter2_;
\r
84 is_same<iter1_,last1_>
\r
85 , is_same<iter2_,last2_>
\r
88 typedef typename result_::type type;
\r
96 typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
\r
97 , typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
\r
98 , typename Predicate = is_same<_,_>
\r
101 : aux::msvc_eti_base<
\r
102 typename aux::equal_impl<Sequence1,Sequence2,Predicate>::type
\r
105 BOOST_MPL_AUX_LAMBDA_SUPPORT(2,equal,(Sequence1,Sequence2))
\r
108 BOOST_MPL_AUX_NA_SPEC(2, equal)
\r
112 #endif // BOOST_MPL_EQUAL_HPP_INCLUDED
\r