os/ossrv/ossrv_pub/boost_apis/boost/tr1/array.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/tr1/array.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,83 @@
     1.4 +//  (C) Copyright John Maddock 2005.
     1.5 +//  Use, modification and distribution are subject to the
     1.6 +//  Boost Software License, Version 1.0. (See accompanying file
     1.7 +//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
     1.8 +
     1.9 +#ifndef BOOST_TR1_ARRAY_HPP_INCLUDED
    1.10 +#  define BOOST_TR1_ARRAY_HPP_INCLUDED
    1.11 +#  include <boost/tr1/detail/config.hpp>
    1.12 +
    1.13 +#ifdef BOOST_HAS_TR1_ARRAY
    1.14 +
    1.15 +#  include BOOST_TR1_HEADER(array)
    1.16 +
    1.17 +#else
    1.18 +
    1.19 +#include <boost/array.hpp>
    1.20 +#include <boost/static_assert.hpp>
    1.21 +#include <boost/type_traits/integral_constant.hpp>
    1.22 +#include <boost/detail/workaround.hpp>
    1.23 +
    1.24 +namespace std{ namespace tr1{
    1.25 +
    1.26 +using ::boost::array;
    1.27 +
    1.28 +#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
    1.29 +// [6.1.3.2] Tuple creation functions
    1.30 +using ::boost::swap;
    1.31 +#endif
    1.32 +
    1.33 +#if !defined(BOOST_TR1_USE_OLD_TUPLE)
    1.34 +}} namespace boost{ namespace fusion{
    1.35 +#endif
    1.36 +
    1.37 +// [6.2.2.5] Tuple interface to class template array
    1.38 +template <class T> struct tuple_size; // forward declaration
    1.39 +template <int I, class T> struct tuple_element; // forward declaration
    1.40 +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
    1.41 +template <class T, size_t N>
    1.42 +struct tuple_size< ::boost::array<T, N> >
    1.43 +   : public ::boost::integral_constant< ::std::size_t, N>{};
    1.44 +
    1.45 +
    1.46 +template <int I, class T, size_t N>
    1.47 +struct tuple_element<I, ::boost::array<T, N> >
    1.48 +{
    1.49 +#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
    1.50 +   BOOST_STATIC_ASSERT(I < (int)N);
    1.51 +   BOOST_STATIC_ASSERT(I >= 0);
    1.52 +#endif
    1.53 +   typedef T type;
    1.54 +};
    1.55 +#endif
    1.56 +template <int I, class T, size_t N>
    1.57 +T& get( ::boost::array<T, N>& a)
    1.58 +{
    1.59 +   BOOST_STATIC_ASSERT(I < N);
    1.60 +   BOOST_STATIC_ASSERT(I >= 0);
    1.61 +   return a[I];
    1.62 +}
    1.63 +
    1.64 +template <int I, class T, size_t N>
    1.65 +const T& get(const array<T, N>& a)
    1.66 +{
    1.67 +   BOOST_STATIC_ASSERT(I < N);
    1.68 +   BOOST_STATIC_ASSERT(I >= 0);
    1.69 +   return a[I];
    1.70 +}
    1.71 +
    1.72 +#if !defined(BOOST_TR1_USE_OLD_TUPLE)
    1.73 +}} namespace std{ namespace tr1{
    1.74 +
    1.75 +   using ::boost::fusion::tuple_size;
    1.76 +   using ::boost::fusion::tuple_element;
    1.77 +   using ::boost::fusion::get;
    1.78 +
    1.79 +#endif
    1.80 +
    1.81 +
    1.82 +} } // namespaces
    1.83 +
    1.84 +#endif
    1.85 +
    1.86 +#endif