epoc32/include/stdapis/boost/mpl/vector/aux_/at.hpp
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
williamr@4
     2
#ifndef BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
williamr@4
     3
#define BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED
williamr@4
     4
williamr@4
     5
// Copyright Aleksey Gurtovoy 2000-2004
williamr@4
     6
//
williamr@4
     7
// Distributed under the Boost Software License, Version 1.0. 
williamr@4
     8
// (See accompanying file LICENSE_1_0.txt or copy at 
williamr@4
     9
// http://www.boost.org/LICENSE_1_0.txt)
williamr@4
    10
//
williamr@4
    11
// See http://www.boost.org/libs/mpl for documentation.
williamr@4
    12
williamr@4
    13
// $Source: /cvsroot/boost/boost/boost/mpl/vector/aux_/at.hpp,v $
williamr@4
    14
// $Date: 2004/12/20 19:35:33 $
williamr@4
    15
// $Revision: 1.6 $
williamr@4
    16
williamr@4
    17
#include <boost/mpl/at_fwd.hpp>
williamr@4
    18
#include <boost/mpl/vector/aux_/tag.hpp>
williamr@4
    19
#include <boost/mpl/long.hpp>
williamr@4
    20
#include <boost/mpl/void.hpp>
williamr@4
    21
#include <boost/mpl/aux_/nttp_decl.hpp>
williamr@4
    22
#include <boost/mpl/aux_/type_wrapper.hpp>
williamr@4
    23
#include <boost/mpl/aux_/value_wknd.hpp>
williamr@4
    24
#include <boost/mpl/aux_/config/typeof.hpp>
williamr@4
    25
#include <boost/mpl/aux_/config/ctps.hpp>
williamr@4
    26
williamr@4
    27
namespace boost { namespace mpl {
williamr@4
    28
williamr@4
    29
#if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
williamr@4
    30
williamr@4
    31
template< typename Vector, long n_ >
williamr@4
    32
struct v_at_impl
williamr@4
    33
{
williamr@4
    34
    typedef long_< (Vector::lower_bound_::value + n_) > index_;
williamr@4
    35
    typedef __typeof__( Vector::item_(index_()) ) type;
williamr@4
    36
};
williamr@4
    37
williamr@4
    38
williamr@4
    39
template< typename Vector, long n_ >
williamr@4
    40
struct v_at
williamr@4
    41
    : aux::wrapped_type< typename v_at_impl<Vector,n_>::type >
williamr@4
    42
{
williamr@4
    43
};
williamr@4
    44
williamr@4
    45
template<>
williamr@4
    46
struct at_impl< aux::vector_tag >
williamr@4
    47
{
williamr@4
    48
    template< typename Vector, typename N > struct apply
williamr@4
    49
        : v_at<
williamr@4
    50
              Vector
williamr@4
    51
            , BOOST_MPL_AUX_VALUE_WKND(N)::value
williamr@4
    52
            >
williamr@4
    53
    {
williamr@4
    54
    };
williamr@4
    55
};
williamr@4
    56
williamr@4
    57
#else
williamr@4
    58
williamr@4
    59
#   if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
williamr@4
    60
    && !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC)
williamr@4
    61
williamr@4
    62
template< typename Vector, BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at;
williamr@4
    63
williamr@4
    64
template< BOOST_MPL_AUX_NTTP_DECL(long, n_) >
williamr@4
    65
struct at_impl< aux::vector_tag<n_> >
williamr@4
    66
{
williamr@4
    67
    template< typename Vector, typename N > struct apply
williamr@4
    68
#if !defined(__BORLANDC__)
williamr@4
    69
        : v_at<
williamr@4
    70
              Vector
williamr@4
    71
            , BOOST_MPL_AUX_VALUE_WKND(N)::value
williamr@4
    72
            >
williamr@4
    73
    {
williamr@4
    74
#else
williamr@4
    75
    {
williamr@4
    76
        typedef typename v_at<
williamr@4
    77
              Vector
williamr@4
    78
            , BOOST_MPL_AUX_VALUE_WKND(N)::value
williamr@4
    79
            >::type type;
williamr@4
    80
#endif
williamr@4
    81
    };
williamr@4
    82
};
williamr@4
    83
williamr@4
    84
#   else
williamr@4
    85
williamr@4
    86
namespace aux {
williamr@4
    87
williamr@4
    88
template< BOOST_MPL_AUX_NTTP_DECL(long, n_) > struct v_at_impl
williamr@4
    89
{
williamr@4
    90
    template< typename V > struct result_;
williamr@4
    91
};
williamr@4
    92
williamr@4
    93
// to work around ETI, etc.
williamr@4
    94
template<> struct v_at_impl<-1>
williamr@4
    95
{
williamr@4
    96
    template< typename V > struct result_
williamr@4
    97
    {
williamr@4
    98
        typedef void_ type;
williamr@4
    99
    };
williamr@4
   100
};
williamr@4
   101
williamr@4
   102
} // namespace aux
williamr@4
   103
williamr@4
   104
template< typename T, BOOST_MPL_AUX_NTTP_DECL(long, n_) >
williamr@4
   105
struct v_at
williamr@4
   106
    : aux::v_at_impl<n_>::template result_<T>
williamr@4
   107
{
williamr@4
   108
};
williamr@4
   109
williamr@4
   110
#   endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
williamr@4
   111
williamr@4
   112
#endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
williamr@4
   113
williamr@4
   114
}}
williamr@4
   115
williamr@4
   116
#endif // BOOST_MPL_VECTOR_AUX_AT_HPP_INCLUDED