1 | // (C) Copyright John Maddock 2005. |
2 | // Use, modification and distribution are subject to the |
3 | // Boost Software License, Version 1.0. (See accompanying file |
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
5 | |
6 | #ifndef BOOST_TR1_TUPLE_HPP_INCLUDED |
7 | # define BOOST_TR1_TUPLE_HPP_INCLUDED |
8 | # include <boost/tr1/detail/config.hpp> |
9 | |
10 | #ifdef BOOST_HAS_TR1_TUPLE |
11 | |
12 | # if defined(BOOST_HAS_INCLUDE_NEXT) && !defined(BOOST_TR1_DISABLE_INCLUDE_NEXT) |
13 | # include_next BOOST_TR1_HEADER(tuple) |
14 | # else |
15 | # include <boost/tr1/detail/config_all.hpp> |
16 | # include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(tuple)) |
17 | # endif |
18 | |
19 | #else |
20 | |
21 | #if defined(BOOST_TR1_USE_OLD_TUPLE) |
22 | |
23 | #include <boost/tuple/tuple.hpp> |
24 | #include <boost/tuple/tuple_comparison.hpp> |
25 | #include <boost/type_traits/integral_constant.hpp> |
26 | |
27 | namespace std{ namespace tr1{ |
28 | |
29 | using ::boost::tuple; |
30 | |
31 | // [6.1.3.2] Tuple creation functions |
32 | using ::boost::tuples::ignore; |
33 | using ::boost::make_tuple; |
34 | using ::boost::tie; |
35 | |
36 | // [6.1.3.3] Tuple helper classes |
37 | template <class T> |
38 | struct tuple_size |
39 | : public ::boost::integral_constant |
40 | < ::std::size_t, ::boost::tuples::length<T>::value> |
41 | {}; |
42 | |
43 | template < int I, class T> |
44 | struct tuple_element |
45 | { |
46 | typedef typename boost::tuples::element<I,T>::type type; |
47 | }; |
48 | |
49 | #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582) |
50 | // [6.1.3.4] Element access |
51 | using ::boost::get; |
52 | #endif |
53 | |
54 | } } // namespaces |
55 | |
56 | #else |
57 | |
58 | #include <boost/fusion/include/tuple.hpp> |
59 | #include <boost/fusion/include/std_pair.hpp> |
60 | |
61 | namespace std{ namespace tr1{ |
62 | |
63 | using ::boost::fusion::tuple; |
64 | |
65 | // [6.1.3.2] Tuple creation functions |
66 | using ::boost::fusion::ignore; |
67 | using ::boost::fusion::make_tuple; |
68 | using ::boost::fusion::tie; |
69 | using ::boost::fusion::get; |
70 | |
71 | // [6.1.3.3] Tuple helper classes |
72 | using ::boost::fusion::tuple_size; |
73 | using ::boost::fusion::tuple_element; |
74 | |
75 | }} |
76 | |
77 | #endif |
78 | |
79 | #endif |
80 | |
81 | #endif |
82 | |
83 | |