Chris@16: Chris@16: #ifndef BOOST_MPL_EQUAL_HPP_INCLUDED Chris@16: #define BOOST_MPL_EQUAL_HPP_INCLUDED Chris@16: Chris@16: // Copyright Aleksey Gurtovoy 2000-2004 Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org/libs/mpl for documentation. Chris@16: Chris@101: // $Id$ Chris@101: // $Date$ Chris@101: // $Revision$ Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { namespace mpl { Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: template< Chris@16: typename Predicate Chris@16: , typename LastIterator1 Chris@16: , typename LastIterator2 Chris@16: > Chris@16: struct equal_pred Chris@16: { Chris@16: template< Chris@16: typename Iterator2 Chris@16: , typename Iterator1 Chris@16: > Chris@16: struct apply Chris@16: { Chris@16: typedef typename and_< Chris@16: not_< is_same > Chris@16: , not_< is_same > Chris@16: , aux::iter_apply2 Chris@16: >::type type; Chris@16: }; Chris@16: }; Chris@16: Chris@16: template< Chris@16: typename Sequence1 Chris@16: , typename Sequence2 Chris@16: , typename Predicate Chris@16: > Chris@16: struct equal_impl Chris@16: { Chris@16: typedef typename begin::type first1_; Chris@16: typedef typename begin::type first2_; Chris@16: typedef typename end::type last1_; Chris@16: typedef typename end::type last2_; Chris@16: Chris@16: typedef aux::iter_fold_if_impl< Chris@16: first1_ Chris@16: , first2_ Chris@16: , next<> Chris@16: , protect< aux::equal_pred > Chris@16: , void_ Chris@16: , always Chris@16: > fold_; Chris@16: Chris@16: typedef typename fold_::iterator iter1_; Chris@16: typedef typename fold_::state iter2_; Chris@16: typedef and_< Chris@16: is_same Chris@16: , is_same Chris@16: > result_; Chris@16: Chris@16: typedef typename result_::type type; Chris@16: }; Chris@16: Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: Chris@16: template< Chris@16: typename BOOST_MPL_AUX_NA_PARAM(Sequence1) Chris@16: , typename BOOST_MPL_AUX_NA_PARAM(Sequence2) Chris@16: , typename Predicate = is_same<_,_> Chris@16: > Chris@16: struct equal Chris@16: : aux::msvc_eti_base< Chris@16: typename aux::equal_impl::type Chris@16: >::type Chris@16: { Chris@16: BOOST_MPL_AUX_LAMBDA_SUPPORT(2,equal,(Sequence1,Sequence2)) Chris@16: }; Chris@16: Chris@16: BOOST_MPL_AUX_NA_SPEC(2, equal) Chris@16: Chris@16: }} Chris@16: Chris@16: #endif // BOOST_MPL_EQUAL_HPP_INCLUDED