sl@0: // (C) Copyright John Maddock 2005. sl@0: // Use, modification and distribution are subject to the sl@0: // Boost Software License, Version 1.0. (See accompanying file sl@0: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: #ifndef BOOST_TR1_ARRAY_HPP_INCLUDED sl@0: # define BOOST_TR1_ARRAY_HPP_INCLUDED sl@0: # include sl@0: sl@0: #ifdef BOOST_HAS_TR1_ARRAY sl@0: sl@0: # include BOOST_TR1_HEADER(array) sl@0: sl@0: #else sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace std{ namespace tr1{ sl@0: sl@0: using ::boost::array; sl@0: sl@0: #if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582) sl@0: // [6.1.3.2] Tuple creation functions sl@0: using ::boost::swap; sl@0: #endif sl@0: sl@0: #if !defined(BOOST_TR1_USE_OLD_TUPLE) sl@0: }} namespace boost{ namespace fusion{ sl@0: #endif sl@0: sl@0: // [6.2.2.5] Tuple interface to class template array sl@0: template struct tuple_size; // forward declaration sl@0: template struct tuple_element; // forward declaration sl@0: #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION sl@0: template sl@0: struct tuple_size< ::boost::array > sl@0: : public ::boost::integral_constant< ::std::size_t, N>{}; sl@0: sl@0: sl@0: template sl@0: struct tuple_element > sl@0: { sl@0: #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) sl@0: BOOST_STATIC_ASSERT(I < (int)N); sl@0: BOOST_STATIC_ASSERT(I >= 0); sl@0: #endif sl@0: typedef T type; sl@0: }; sl@0: #endif sl@0: template sl@0: T& get( ::boost::array& a) sl@0: { sl@0: BOOST_STATIC_ASSERT(I < N); sl@0: BOOST_STATIC_ASSERT(I >= 0); sl@0: return a[I]; sl@0: } sl@0: sl@0: template sl@0: const T& get(const array& a) sl@0: { sl@0: BOOST_STATIC_ASSERT(I < N); sl@0: BOOST_STATIC_ASSERT(I >= 0); sl@0: return a[I]; sl@0: } sl@0: sl@0: #if !defined(BOOST_TR1_USE_OLD_TUPLE) sl@0: }} namespace std{ namespace tr1{ sl@0: sl@0: using ::boost::fusion::tuple_size; sl@0: using ::boost::fusion::tuple_element; sl@0: using ::boost::fusion::get; sl@0: sl@0: #endif sl@0: sl@0: sl@0: } } // namespaces sl@0: sl@0: #endif sl@0: sl@0: #endif