1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2006 Dan Marsden
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_EQUAL_TO_IMPL_20060128_1423)
9 #define FUSION_EQUAL_TO_IMPL_20060128_1423
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/mpl.hpp>
14 #include <boost/mpl/lambda.hpp>
15 #include <boost/mpl/and.hpp>
16 #include <boost/mpl/transform_view.hpp>
17 #include <boost/mpl/zip_view.hpp>
18 #include <boost/mpl/vector.hpp>
19 #include <boost/mpl/unpack_args.hpp>
20 #include <boost/mpl/find_if.hpp>
21 #include <boost/mpl/end.hpp>
22 #include <boost/mpl/bool.hpp>
23 #include <boost/mpl/equal_to.hpp>
25 #include <boost/type_traits/is_same.hpp>
27 #include <boost/fusion/iterator/equal_to.hpp>
29 namespace boost { namespace fusion {
31 struct zip_view_iterator_tag;
35 template<typename It1, typename It2>
36 struct zip_iterators_equal
38 typedef mpl::zip_view<mpl::vector2<typename It1::iterators, typename It2::iterators> > zipped;
39 typedef mpl::transform_view<zipped, mpl::unpack_args<result_of::equal_to<mpl::_,mpl::_> > > transformed;
41 typedef typename mpl::find_if<transformed, mpl::equal_to<mpl::_, mpl::false_> >::type found;
43 typedef typename is_same<typename mpl::end<transformed>::type, found>::type type;
49 template<typename Tag>
53 struct equal_to_impl<zip_view_iterator_tag>
55 template<typename It1, typename It2>
57 : detail::zip_iterators_equal<It1, It2>::type