sl@0: // tuple.hpp - Boost Tuple Library -------------------------------------- sl@0: sl@0: // Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi) sl@0: // sl@0: // Distributed under the Boost Software License, Version 1.0. (See sl@0: // accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // For more information, see http://www.boost.org sl@0: sl@0: // ----------------------------------------------------------------- sl@0: sl@0: #ifndef BOOST_TUPLE_HPP sl@0: #define BOOST_TUPLE_HPP sl@0: sl@0: #if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 sl@0: // Work around a compiler bug. sl@0: // boost::python::tuple has to be seen by the compiler before the sl@0: // boost::tuple class template. sl@0: namespace boost { namespace python { class tuple; }} sl@0: #endif sl@0: sl@0: #include "boost/config.hpp" sl@0: #include "boost/static_assert.hpp" sl@0: sl@0: #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) sl@0: // The MSVC version sl@0: #include "boost/tuple/detail/tuple_basic_no_partial_spec.hpp" sl@0: sl@0: #else sl@0: // other compilers sl@0: #include "boost/ref.hpp" sl@0: #include "boost/tuple/detail/tuple_basic.hpp" sl@0: sl@0: #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION sl@0: sl@0: namespace boost { sl@0: sl@0: using tuples::tuple; sl@0: using tuples::make_tuple; sl@0: using tuples::tie; sl@0: #if !defined(BOOST_NO_USING_TEMPLATE) sl@0: using tuples::get; sl@0: #elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) sl@0: // sl@0: // The "using tuples::get" statement causes the sl@0: // Borland compiler to ICE, use forwarding sl@0: // functions instead: sl@0: // sl@0: template sl@0: inline typename tuples::access_traits< sl@0: typename tuples::element >::type sl@0: >::non_const_type sl@0: get(tuples::cons& c) { sl@0: return tuples::get(c); sl@0: } sl@0: // get function for const cons-lists, returns a const reference to sl@0: // the element. If the element is a reference, returns the reference sl@0: // as such (that is, can return a non-const reference) sl@0: template sl@0: inline typename tuples::access_traits< sl@0: typename tuples::element >::type sl@0: >::const_type sl@0: get(const tuples::cons& c) { sl@0: return tuples::get(c); sl@0: } sl@0: #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION sl@0: // sl@0: // MSVC, using declarations don't mix with templates well, sl@0: // so use forwarding functions instead: sl@0: // sl@0: template sl@0: typename tuples::detail::element_ref >::RET sl@0: get(tuples::cons& t, tuples::detail::workaround_holder* = 0) sl@0: { sl@0: return tuples::detail::get_class::get(t); sl@0: } sl@0: sl@0: template sl@0: typename tuples::detail::element_const_ref >::RET sl@0: get(const tuples::cons& t, tuples::detail::workaround_holder* = 0) sl@0: { sl@0: return tuples::detail::get_class::get(t); sl@0: } sl@0: #endif // BOOST_NO_USING_TEMPLATE sl@0: sl@0: } // end namespace boost sl@0: sl@0: sl@0: #endif // BOOST_TUPLE_HPP