Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:41:54

0001 
0002 #ifndef BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED
0003 #define BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED
0004 
0005 // Copyright Aleksey Gurtovoy 2000-2004
0006 //
0007 // Distributed under the Boost Software License, Version 1.0. 
0008 // (See accompanying file LICENSE_1_0.txt or copy at 
0009 // http://www.boost.org/LICENSE_1_0.txt)
0010 //
0011 // See http://www.boost.org/libs/mpl for documentation.
0012 
0013 // $Id$
0014 // $Date$
0015 // $Revision$
0016 
0017 #include <boost/mpl/long.hpp>
0018 #include <boost/mpl/void.hpp>
0019 #include <boost/mpl/next_prior.hpp>
0020 #include <boost/mpl/aux_/type_wrapper.hpp>
0021 #include <boost/mpl/aux_/config/typeof.hpp>
0022 #include <boost/mpl/aux_/config/ctps.hpp>
0023 
0024 namespace boost { namespace mpl {
0025 
0026 #if defined(BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES)
0027 
0028 template< 
0029       typename T
0030     , typename Base
0031     , int at_front = 0
0032     >
0033 struct v_item
0034     : Base
0035 {
0036     typedef typename Base::upper_bound_ index_;
0037     typedef typename next<index_>::type upper_bound_;
0038     typedef typename next<typename Base::size>::type size;
0039     typedef Base base;
0040     typedef v_item type;
0041 
0042     // agurt 10/sep/04: MWCW <= 9.3 workaround here and below; the compiler
0043     // breaks if using declaration comes _before_ the new overload
0044     static aux::type_wrapper<T> item_(index_);
0045     using Base::item_;
0046 };
0047 
0048 template<
0049       typename T
0050     , typename Base
0051     >
0052 struct v_item<T,Base,1>
0053     : Base
0054 {
0055     typedef typename prior<typename Base::lower_bound_>::type index_;
0056     typedef index_ lower_bound_;
0057     typedef typename next<typename Base::size>::type size;
0058     typedef Base base;
0059     typedef v_item type;
0060 
0061     static aux::type_wrapper<T> item_(index_);
0062     using Base::item_;
0063 };
0064 
0065 // "erasure" item
0066 template< 
0067       typename Base
0068     , int at_front
0069     >
0070 struct v_mask
0071     : Base
0072 {
0073     typedef typename prior<typename Base::upper_bound_>::type index_;
0074     typedef index_ upper_bound_;
0075     typedef typename prior<typename Base::size>::type size;
0076     typedef Base base;
0077     typedef v_mask type;
0078 
0079     static aux::type_wrapper<void_> item_(index_);
0080     using Base::item_;
0081 };
0082 
0083 template< 
0084       typename Base
0085     >
0086 struct v_mask<Base,1>
0087     : Base
0088 {
0089     typedef typename Base::lower_bound_ index_;
0090     typedef typename next<index_>::type lower_bound_;
0091     typedef typename prior<typename Base::size>::type size;
0092     typedef Base base;
0093     typedef v_mask type;
0094 
0095     static aux::type_wrapper<void_> item_(index_);
0096     using Base::item_;
0097 };
0098 
0099 #endif // BOOST_MPL_CFG_TYPEOF_BASED_SEQUENCES
0100 
0101 }}
0102 
0103 #endif // BOOST_MPL_VECTOR_AUX_ITEM_HPP_INCLUDED