1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_DEREF_IMPL_07162005_1026)
8 #define FUSION_DEREF_IMPL_07162005_1026
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/mpl/apply.hpp>
12 #include <boost/fusion/iterator/deref.hpp>
13 #include <boost/fusion/iterator/value_of.hpp>
14 #include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp>
16 namespace boost { namespace fusion
18 struct transform_view_iterator_tag;
19 struct transform_view_iterator2_tag;
23 template <typename Tag>
28 struct deref_impl<transform_view_iterator_tag>
30 template <typename Iterator>
34 result_of::deref<typename Iterator::first_type>::type
37 typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
38 typedef typename mpl::apply<transform_type, value_type>::type type;
40 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
42 call(Iterator const& i)
51 struct deref_impl<transform_view_iterator2_tag>
53 template <typename Iterator>
57 result_of::deref<typename Iterator::first1_type>::type
60 result_of::deref<typename Iterator::first2_type>::type
63 typedef detail::apply_transform_result<typename Iterator::transform_type> transform_type;
64 typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type;
66 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
68 call(Iterator const& i)
70 return i.f(*i.first1, *i.first2);