]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | Copyright (c) 2005-2006 Dan Marsden | |
4 | ||
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(BOOST_FUSION_VALUE_AT_IMPL_20061101_0745) | |
9 | #define BOOST_FUSION_VALUE_AT_IMPL_20061101_0745 | |
10 | ||
11 | #include <boost/fusion/support/config.hpp> | |
12 | #include <boost/mpl/apply.hpp> | |
13 | #include <boost/fusion/view/transform_view/detail/apply_transform_result.hpp> | |
14 | #include <boost/fusion/sequence/intrinsic/value_at.hpp> | |
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 value_at_impl; | |
24 | ||
25 | template<> | |
26 | struct value_at_impl<transform_view_tag> | |
27 | { | |
28 | template<typename Seq, typename N> | |
29 | struct apply | |
30 | { | |
31 | typedef typename Seq::transform_type F; | |
32 | typedef detail::apply_transform_result<F> transform_type; | |
33 | typedef typename boost::fusion::result_of::value_at<typename Seq::sequence_type, N>::type value_type; | |
34 | typedef typename mpl::apply<transform_type, value_type>::type type; | |
35 | }; | |
36 | }; | |
37 | ||
38 | template<> | |
39 | struct value_at_impl<transform_view2_tag> | |
40 | { | |
41 | template<typename Seq, typename N> | |
42 | struct apply | |
43 | { | |
44 | typedef typename Seq::transform_type F; | |
45 | typedef detail::apply_transform_result<F> transform_type; | |
46 | typedef typename boost::fusion::result_of::value_at<typename Seq::sequence1_type, N>::type value1_type; | |
47 | typedef typename boost::fusion::result_of::value_at<typename Seq::sequence2_type, N>::type value2_type; | |
48 | typedef typename mpl::apply<transform_type, value1_type, value2_type>::type type; | |
49 | }; | |
50 | }; | |
51 | } | |
52 | }} | |
53 | ||
54 | #endif |