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_DEREF_IMPL_20061024_1959)
9 #define FUSION_DEREF_IMPL_20061024_1959
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/container/vector.hpp>
13 #include <boost/fusion/iterator/deref.hpp>
14 #include <boost/fusion/algorithm/transformation/transform.hpp>
15 #include <boost/fusion/container/vector/convert.hpp>
16 #include <boost/fusion/support/unused.hpp>
17 #include <boost/mpl/eval_if.hpp>
18 #include <boost/mpl/identity.hpp>
19 #include <boost/type_traits/is_same.hpp>
20 #include <boost/type_traits/remove_reference.hpp>
21 #include <boost/type_traits/remove_const.hpp>
23 namespace boost { namespace fusion {
25 struct zip_view_iterator_tag;
31 template<typename Sig>
35 struct result<poly_deref(It)>
37 typedef typename remove_const<
38 typename remove_reference<It>::type>::type it;
40 typedef typename mpl::eval_if<is_same<it, unused_type>,
41 mpl::identity<unused_type>,
42 result_of::deref<it> >::type type;
46 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
47 typename result<poly_deref(It)>::type
48 operator()(const It& it) const
50 return fusion::deref(it);
53 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
54 unused_type operator()(unused_type const&) const
63 template<typename Tag>
67 struct deref_impl<zip_view_iterator_tag>
72 typedef typename result_of::as_vector<
73 typename result_of::transform<typename It::iterators, detail::poly_deref>::type>::type type;
75 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
80 fusion::transform(it.iterators_, detail::poly_deref()));