2 #ifndef BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
\r
3 #define BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
\r
5 // Copyright Aleksey Gurtovoy 2000-2004
\r
7 // Distributed under the Boost Software License, Version 1.0.
\r
8 // (See accompanying file LICENSE_1_0.txt or copy at
\r
9 // http://www.boost.org/LICENSE_1_0.txt)
\r
11 // See http://www.boost.org/libs/mpl for documentation.
\r
13 // $Id: at.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
\r
14 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
\r
15 // $Revision: 49267 $
\r
17 #include <boost/mpl/at_fwd.hpp>
\r
18 #include <boost/mpl/vector/aux_/tag.hpp>
\r
19 #include <boost/mpl/long.hpp>
\r
20 #include <boost/mpl/void.hpp>
\r
21 #include <boost/mpl/aux_/nttp_decl.hpp>
\r
22 #include <boost/mpl/aux_/type_wrapper.hpp>
\r
23 #include <boost/mpl/aux_/value_wknd.hpp>
\r
24 #include <boost/mpl/aux_/config/typeof.hpp>
\r
25 #include <boost/mpl/aux_/config/ctps.hpp>
\r
27 namespace boost { namespace mpl {
\r
29 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
\r
31 template< typename Vector, long n_ >
\r
34 typedef long_< (Vector::lower_bound_::value + n_) > index_;
\r
35 typedef __typeof__( Vector::item_(index_()) ) type;
\r
39 template< typename Vector, long n_ >
\r
41 : aux::wrapped_type< typename v_at_impl<Vector,n_>::type >
\r
46 struct at_impl< aux::vector_tag >
\r
48 template< typename Vector, typename N > struct apply
\r
51 , BOOST_MPL_AUX_VALUE_WKND(N)::value
\r
59 # if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
\r
60 && !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC)
\r
62 template< typename Vector, BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at;
\r
64 template< BOOST_MPL_AUX_NTTP_DECL(long, n_) >
\r
65 struct at_impl< aux::vector_tag<n_> >
\r
67 template< typename Vector, typename N > struct apply
\r
68 #if !defined(__BORLANDC__)
\r
71 , BOOST_MPL_AUX_VALUE_WKND(N)::value
\r
76 typedef typename v_at<
\r
78 , BOOST_MPL_AUX_VALUE_WKND(N)::value
\r
88 template< BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at_impl
\r
90 template< typename V > struct result_;
\r
93 // to work around ETI, etc.
\r
94 template<> struct v_at_impl<-1>
\r
96 template< typename V > struct result_
\r
104 template< typename T, BOOST_MPL_AUX_NTTP_DECL(long, n_) >
\r
106 : aux::v_at_impl<n_>::template result_<T>
\r
110 # endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
\r
112 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
\r
116 #endif // BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
\r