1 // tuple.hpp - Boost Tuple Library --------------------------------------
3 // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
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)
9 // For more information, see http://www.boost.org
11 // -----------------------------------------------------------------
13 #ifndef BOOST_TUPLE_HPP
14 #define BOOST_TUPLE_HPP
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; }}
23 #include "boost/config.hpp"
24 #include "boost/static_assert.hpp"
27 #include "boost/ref.hpp"
28 #include "boost/tuple/detail/tuple_basic.hpp"
34 using tuples::make_tuple;
36 #if !defined(BOOST_NO_USING_TEMPLATE)
40 // The "using tuples::get" statement causes the
41 // Borland compiler to ICE, use forwarding
44 template<int N, class HT, class TT>
45 inline typename tuples::access_traits<
46 typename tuples::element<N, tuples::cons<HT, TT> >::type
48 get(tuples::cons<HT, TT>& c) {
49 return tuples::get<N,HT,TT>(c);
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
58 get(const tuples::cons<HT, TT>& c) {
59 return tuples::get<N,HT,TT>(c);
62 #endif // BOOST_NO_USING_TEMPLATE
64 } // end namespace boost
67 #endif // BOOST_TUPLE_HPP