]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | ||
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_TRANSFORM_07052005_1057) | |
8 | #define FUSION_TRANSFORM_07052005_1057 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/view/transform_view/transform_view.hpp> | |
12 | ||
13 | namespace boost { namespace fusion | |
14 | { | |
15 | struct void_; | |
16 | ||
17 | namespace result_of | |
18 | { | |
19 | template <typename Sequence1, typename Sequence2, typename F = void_> | |
20 | struct transform | |
21 | { | |
22 | typedef transform_view<Sequence1, Sequence2, F> type; | |
23 | }; | |
24 | ||
25 | template <typename Sequence, typename F> | |
26 | #if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) | |
27 | struct transform<Sequence, F, void_> | |
28 | #else | |
29 | struct transform<Sequence, F> | |
30 | #endif | |
31 | { | |
32 | typedef transform_view<Sequence, F> type; | |
33 | }; | |
34 | } | |
35 | ||
36 | template <typename Sequence, typename F> | |
37 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
38 | inline typename result_of::transform<Sequence const, F>::type | |
39 | transform(Sequence const& seq, F f) | |
40 | { | |
41 | return transform_view<Sequence const, F>(seq, f); | |
42 | } | |
43 | ||
44 | template <typename Sequence1, typename Sequence2, typename F> | |
45 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
46 | inline typename result_of::transform<Sequence1 const, Sequence2 const, F>::type | |
47 | transform(Sequence1 const& seq1, Sequence2 const& seq2, F f) | |
48 | { | |
49 | return transform_view<Sequence1 const, Sequence2 const, F>(seq1, seq2, f); | |
50 | } | |
51 | }} | |
52 | ||
53 | #endif | |
54 |