1 | // tuple.hpp - Boost Tuple Library -------------------------------------- |
2 | |
3 | // Copyright (C) 1999, 2000 Jaakko Jarvi ([email protected]) |
4 | // |
5 | // Distributed under the Boost Software License, Version 1.0. (See |
6 | // accompanying file LICENSE_1_0.txt or copy at |
7 | // http://www.boost.org/LICENSE_1_0.txt) |
8 | |
9 | // For more information, see http://www.boost.org |
10 | |
11 | // ----------------------------------------------------------------- |
12 | |
13 | #ifndef BOOST_TUPLE_HPP |
14 | #define BOOST_TUPLE_HPP |
15 | |
16 | #if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 |
17 | // Work around a compiler bug. |
18 | // boost::python::tuple has to be seen by the compiler before the |
19 | // boost::tuple class template. |
20 | namespace boost { namespace python { class tuple; }} |
21 | #endif |
22 | |
23 | #include "boost/config.hpp" |
24 | #include "boost/static_assert.hpp" |
25 | |
26 | // other compilers |
27 | #include "boost/ref.hpp" |
28 | #include "boost/tuple/detail/tuple_basic.hpp" |
29 | |
30 | |
31 | namespace boost { |
32 | |
33 | using tuples::tuple; |
34 | using tuples::make_tuple; |
35 | using tuples::tie; |
36 | #if !defined(BOOST_NO_USING_TEMPLATE) |
37 | using tuples::get; |
38 | #else |
39 | // |
40 | // The "using tuples::get" statement causes the |
41 | // Borland compiler to ICE, use forwarding |
42 | // functions instead: |
43 | // |
44 | template<int N, class HT, class TT> |
45 | inline typename tuples::access_traits< |
46 | typename tuples::element<N, tuples::cons<HT, TT> >::type |
47 | >::non_const_type |
48 | get(tuples::cons<HT, TT>& c) { |
49 | return tuples::get<N,HT,TT>(c); |
50 | } |
51 | // get function for const cons-lists, returns a const reference to |
52 | // the element. If the element is a reference, returns the reference |
53 | // as such (that is, can return a non-const reference) |
54 | template<int N, class HT, class TT> |
55 | inline typename tuples::access_traits< |
56 | typename tuples::element<N, tuples::cons<HT, TT> >::type |
57 | >::const_type |
58 | get(const tuples::cons<HT, TT>& c) { |
59 | return tuples::get<N,HT,TT>(c); |
60 | } |
61 | |
62 | #endif // BOOST_NO_USING_TEMPLATE |
63 | |
64 | } // end namespace boost |
65 | |
66 | |
67 | #endif // BOOST_TUPLE_HPP |
68 | |