1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
3 Copyright (c) 2018 Kohei Takahashi
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_07162005_1026)
9 #define FUSION_DEREF_IMPL_07162005_1026
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/deref.hpp>
13 #include <boost/utility/result_of.hpp>
15 namespace boost { namespace fusion
17 struct transform_view_iterator_tag;
18 struct transform_view_iterator2_tag;
22 template <typename Tag>
27 struct deref_impl<transform_view_iterator_tag>
29 template <typename Iterator>
33 result_of::deref<typename Iterator::first_type>::type
36 typedef typename Iterator::transform_type F;
37 typedef typename boost::result_of<F(value_type)>::type type;
39 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
41 call(Iterator const& i)
50 struct deref_impl<transform_view_iterator2_tag>
52 template <typename Iterator>
56 result_of::deref<typename Iterator::first1_type>::type
59 result_of::deref<typename Iterator::first2_type>::type
62 typedef typename Iterator::transform_type F;
63 typedef typename boost::result_of<F(value1_type, value2_type)>::type type;
65 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
67 call(Iterator const& i)
69 return i.f(*i.first1, *i.first2);