1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/mpl/vector/aux_/at.hpp Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,116 @@
1.4 +
1.5 +#ifndef BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
1.6 +#define BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
1.7 +
1.8 +// Copyright Aleksey Gurtovoy 2000-2004
1.9 +//
1.10 +// Distributed under the Boost Software License, Version 1.0.
1.11 +// (See accompanying file LICENSE_1_0.txt or copy at
1.12 +// http://www.boost.org/LICENSE_1_0.txt)
1.13 +//
1.14 +// See http://www.boost.org/libs/mpl for documentation.
1.15 +
1.16 +// $Source: /cvsroot/boost/boost/boost/mpl/vector/aux_/at.hpp,v $
1.17 +// $Date: 2004/12/20 19:35:33 $
1.18 +// $Revision: 1.6 $
1.19 +
1.20 +#include <boost/mpl/at_fwd.hpp>
1.21 +#include <boost/mpl/vector/aux_/tag.hpp>
1.22 +#include <boost/mpl/long.hpp>
1.23 +#include <boost/mpl/void.hpp>
1.24 +#include <boost/mpl/aux_/nttp_decl.hpp>
1.25 +#include <boost/mpl/aux_/type_wrapper.hpp>
1.26 +#include <boost/mpl/aux_/value_wknd.hpp>
1.27 +#include <boost/mpl/aux_/config/typeof.hpp>
1.28 +#include <boost/mpl/aux_/config/ctps.hpp>
1.29 +
1.30 +namespace boost { namespace mpl {
1.31 +
1.32 +#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
1.33 +
1.34 +template< typename Vector, long n_ >
1.35 +struct v_at_impl
1.36 +{
1.37 + typedef long_< (Vector::lower_bound_::value + n_) > index_;
1.38 + typedef __typeof__( Vector::item_(index_()) ) type;
1.39 +};
1.40 +
1.41 +
1.42 +template< typename Vector, long n_ >
1.43 +struct v_at
1.44 + : aux::wrapped_type< typename v_at_impl<Vector,n_>::type >
1.45 +{
1.46 +};
1.47 +
1.48 +template<>
1.49 +struct at_impl< aux::vector_tag >
1.50 +{
1.51 + template< typename Vector, typename N > struct apply
1.52 + : v_at<
1.53 + Vector
1.54 + , BOOST_MPL_AUX_VALUE_WKND(N)::value
1.55 + >
1.56 + {
1.57 + };
1.58 +};
1.59 +
1.60 +#else
1.61 +
1.62 +# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
1.63 + && !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC)
1.64 +
1.65 +template< typename Vector, BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at;
1.66 +
1.67 +template< BOOST_MPL_AUX_NTTP_DECL(long, n_) >
1.68 +struct at_impl< aux::vector_tag<n_> >
1.69 +{
1.70 + template< typename Vector, typename N > struct apply
1.71 +#if !defined(__BORLANDC__)
1.72 + : v_at<
1.73 + Vector
1.74 + , BOOST_MPL_AUX_VALUE_WKND(N)::value
1.75 + >
1.76 + {
1.77 +#else
1.78 + {
1.79 + typedef typename v_at<
1.80 + Vector
1.81 + , BOOST_MPL_AUX_VALUE_WKND(N)::value
1.82 + >::type type;
1.83 +#endif
1.84 + };
1.85 +};
1.86 +
1.87 +# else
1.88 +
1.89 +namespace aux {
1.90 +
1.91 +template< BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at_impl
1.92 +{
1.93 + template< typename V > struct result_;
1.94 +};
1.95 +
1.96 +// to work around ETI, etc.
1.97 +template<> struct v_at_impl<-1>
1.98 +{
1.99 + template< typename V > struct result_
1.100 + {
1.101 + typedef void_ type;
1.102 + };
1.103 +};
1.104 +
1.105 +} // namespace aux
1.106 +
1.107 +template< typename T, BOOST_MPL_AUX_NTTP_DECL(long, n_) >
1.108 +struct v_at
1.109 + : aux::v_at_impl<n_>::template result_<T>
1.110 +{
1.111 +};
1.112 +
1.113 +# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
1.114 +
1.115 +#endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
1.116 +
1.117 +}}
1.118 +
1.119 +#endif // BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED