]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | Copyright (c) 2005-2006 Dan Marsden | |
92f5a8d4 | 4 | Copyright (c) 2018 Kohei Takahashi |
7c673cae FG |
5 | |
6 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
7 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
8 | ==============================================================================*/ | |
9 | #if !defined(BOOST_FUSION_AT_IMPL_20061029_1946) | |
10 | #define BOOST_FUSION_AT_IMPL_20061029_1946 | |
11 | ||
12 | #include <boost/fusion/support/config.hpp> | |
7c673cae | 13 | #include <boost/fusion/sequence/intrinsic/at.hpp> |
92f5a8d4 | 14 | #include <boost/utility/result_of.hpp> |
7c673cae FG |
15 | |
16 | namespace boost { namespace fusion { | |
17 | struct transform_view_tag; | |
18 | struct transform_view2_tag; | |
19 | ||
20 | namespace extension | |
21 | { | |
22 | template<typename Tag> | |
23 | struct at_impl; | |
24 | ||
25 | template<> | |
26 | struct at_impl<transform_view_tag> | |
27 | { | |
28 | template<typename Seq, typename N> | |
29 | struct apply | |
30 | { | |
31 | typedef typename Seq::transform_type F; | |
92f5a8d4 TL |
32 | typedef typename result_of::at<typename Seq::sequence_type, N>::type value_type; |
33 | typedef typename boost::result_of<F(value_type)>::type type; | |
7c673cae FG |
34 | |
35 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
36 | static type call(Seq& seq) | |
37 | { | |
38 | return seq.f(boost::fusion::at<N>(seq.seq)); | |
39 | } | |
40 | }; | |
41 | }; | |
42 | ||
43 | template<> | |
44 | struct at_impl<transform_view2_tag> | |
45 | { | |
46 | template<typename Seq, typename N> | |
47 | struct apply | |
48 | { | |
49 | typedef typename Seq::transform_type F; | |
92f5a8d4 TL |
50 | typedef typename result_of::at<typename Seq::sequence1_type, N>::type value1_type; |
51 | typedef typename result_of::at<typename Seq::sequence2_type, N>::type value2_type; | |
52 | typedef typename boost::result_of<F(value1_type, value2_type)>::type type; | |
7c673cae FG |
53 | |
54 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
55 | static type call(Seq& seq) | |
56 | { | |
57 | return seq.f(boost::fusion::at<N>(seq.seq1), boost::fusion::at<N>(seq.seq2)); | |
58 | } | |
59 | }; | |
60 | }; | |
61 | } | |
62 | }} | |
63 | ||
64 | #endif |