]>
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_VALUE_OF_05052005_1126) | |
8 | #define FUSION_VALUE_OF_05052005_1126 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/support/iterator_base.hpp> | |
12 | #include <boost/fusion/support/tag_of.hpp> | |
13 | ||
14 | namespace boost { namespace fusion | |
15 | { | |
16 | // Special tags: | |
17 | struct iterator_facade_tag; // iterator facade tag | |
18 | struct boost_array_iterator_tag; // boost::array iterator tag | |
19 | struct mpl_iterator_tag; // mpl sequence iterator tag | |
20 | struct std_pair_iterator_tag; // std::pair iterator tag | |
21 | ||
22 | namespace extension | |
23 | { | |
24 | template <typename Tag> | |
25 | struct value_of_impl | |
26 | { | |
27 | template <typename Iterator> | |
28 | struct apply {}; | |
29 | }; | |
30 | ||
31 | template <> | |
32 | struct value_of_impl<iterator_facade_tag> | |
33 | { | |
34 | template <typename Iterator> | |
35 | struct apply : Iterator::template value_of<Iterator> {}; | |
36 | }; | |
37 | ||
38 | template <> | |
39 | struct value_of_impl<boost_array_iterator_tag>; | |
40 | ||
41 | template <> | |
42 | struct value_of_impl<mpl_iterator_tag>; | |
43 | ||
44 | template <> | |
45 | struct value_of_impl<std_pair_iterator_tag>; | |
46 | } | |
47 | ||
48 | namespace result_of | |
49 | { | |
50 | template <typename Iterator> | |
51 | struct value_of | |
52 | : extension::value_of_impl<typename detail::tag_of<Iterator>::type>:: | |
53 | template apply<Iterator> | |
54 | {}; | |
55 | } | |
56 | }} | |
57 | ||
58 | #endif |