1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/mpl/equal.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,112 @@
1.4 +
1.5 +#ifndef BOOST_MPL_EQUAL_HPP_INCLUDED
1.6 +#define BOOST_MPL_EQUAL_HPP_INCLUDED
1.7 +
1.8 +// Copyright Aleksey Gurtovoy 2000-2004
1.9 +//
1.10 +// Distributed under the Boost Software License, Version 1.0.
1.11 +// (See accompanying file LICENSE_1_0.txt or copy at
1.12 +// http://www.boost.org/LICENSE_1_0.txt)
1.13 +//
1.14 +// See http://www.boost.org/libs/mpl for documentation.
1.15 +
1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/equal.hpp,v $
1.17 +// $Date: 2004/09/02 15:40:41 $
1.18 +// $Revision: 1.6 $
1.19 +
1.20 +#include <boost/mpl/aux_/iter_fold_if_impl.hpp>
1.21 +#include <boost/mpl/aux_/iter_apply.hpp>
1.22 +#include <boost/mpl/and.hpp>
1.23 +#include <boost/mpl/not.hpp>
1.24 +#include <boost/mpl/begin_end.hpp>
1.25 +#include <boost/mpl/next.hpp>
1.26 +#include <boost/mpl/always.hpp>
1.27 +#include <boost/mpl/bool.hpp>
1.28 +#include <boost/mpl/lambda.hpp>
1.29 +#include <boost/mpl/bind.hpp>
1.30 +#include <boost/mpl/apply.hpp>
1.31 +#include <boost/mpl/void.hpp>
1.32 +#include <boost/mpl/aux_/na_spec.hpp>
1.33 +#include <boost/mpl/aux_/lambda_support.hpp>
1.34 +#include <boost/mpl/aux_/msvc_eti_base.hpp>
1.35 +
1.36 +#include <boost/type_traits/is_same.hpp>
1.37 +
1.38 +namespace boost { namespace mpl {
1.39 +
1.40 +namespace aux {
1.41 +
1.42 +template<
1.43 + typename Predicate
1.44 + , typename LastIterator1
1.45 + , typename LastIterator2
1.46 + >
1.47 +struct equal_pred
1.48 +{
1.49 + template<
1.50 + typename Iterator2
1.51 + , typename Iterator1
1.52 + >
1.53 + struct apply
1.54 + {
1.55 + typedef typename and_<
1.56 + not_< is_same<Iterator1,LastIterator1> >
1.57 + , not_< is_same<Iterator2,LastIterator2> >
1.58 + , aux::iter_apply2<Predicate,Iterator1,Iterator2>
1.59 + >::type type;
1.60 + };
1.61 +};
1.62 +
1.63 +template<
1.64 + typename Sequence1
1.65 + , typename Sequence2
1.66 + , typename Predicate
1.67 + >
1.68 +struct equal_impl
1.69 +{
1.70 + typedef typename begin<Sequence1>::type first1_;
1.71 + typedef typename begin<Sequence2>::type first2_;
1.72 + typedef typename end<Sequence1>::type last1_;
1.73 + typedef typename end<Sequence2>::type last2_;
1.74 +
1.75 + typedef aux::iter_fold_if_impl<
1.76 + first1_
1.77 + , first2_
1.78 + , next<>
1.79 + , protect< aux::equal_pred<Predicate,last1_,last2_> >
1.80 + , void_
1.81 + , always<false_>
1.82 + > fold_;
1.83 +
1.84 + typedef typename fold_::iterator iter1_;
1.85 + typedef typename fold_::state iter2_;
1.86 + typedef and_<
1.87 + is_same<iter1_,last1_>
1.88 + , is_same<iter2_,last2_>
1.89 + > result_;
1.90 +
1.91 + typedef typename result_::type type;
1.92 +};
1.93 +
1.94 +
1.95 +} // namespace aux
1.96 +
1.97 +
1.98 +template<
1.99 + typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
1.100 + , typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
1.101 + , typename Predicate = is_same<_,_>
1.102 + >
1.103 +struct equal
1.104 + : aux::msvc_eti_base<
1.105 + typename aux::equal_impl<Sequence1,Sequence2,Predicate>::type
1.106 + >::type
1.107 +{
1.108 + BOOST_MPL_AUX_LAMBDA_SUPPORT(2,equal,(Sequence1,Sequence2))
1.109 +};
1.110 +
1.111 +BOOST_MPL_AUX_NA_SPEC(2, equal)
1.112 +
1.113 +}}
1.114 +
1.115 +#endif // BOOST_MPL_EQUAL_HPP_INCLUDED