Back to home page

EIC code displayed by LXR

 
 

    


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

0001 
0002 #if !defined(BOOST_PP_IS_ITERATING)
0003 
0004 ///// header body
0005 
0006 #ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
0007 #define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
0008 
0009 // Copyright Aleksey Gurtovoy 2000-2004
0010 //
0011 // Distributed under the Boost Software License, Version 1.0. 
0012 // (See accompanying file LICENSE_1_0.txt or copy at 
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 //
0015 // See http://www.boost.org/libs/mpl for documentation.
0016 
0017 // $Id$
0018 // $Date$
0019 // $Revision$
0020 
0021 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
0022 #   include <boost/mpl/prior.hpp>
0023 #   include <boost/mpl/apply_wrap.hpp>
0024 #endif
0025 
0026 #include <boost/mpl/aux_/config/use_preprocessed.hpp>
0027 
0028 #if    !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
0029     && !defined(BOOST_MPL_PREPROCESSING_MODE)
0030 
0031 #   define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
0032 #   include <boost/mpl/aux_/include_preprocessed.hpp>
0033 
0034 #else
0035 
0036 #   include <boost/mpl/limits/unrolling.hpp>
0037 #   include <boost/mpl/aux_/nttp_decl.hpp>
0038 #   include <boost/mpl/aux_/config/eti.hpp>
0039 
0040 #   include <boost/preprocessor/iterate.hpp>
0041 #   include <boost/preprocessor/cat.hpp>
0042 #   include <boost/preprocessor/inc.hpp>
0043 
0044 namespace boost { namespace mpl { namespace aux {
0045 
0046 // forward declaration
0047 template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
0048 
0049 #   define BOOST_PP_ITERATION_PARAMS_1 \
0050     (3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
0051 #   include BOOST_PP_ITERATE()
0052 
0053 // implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
0054 template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
0055 struct advance_backward
0056 {
0057     template< typename Iterator > struct apply
0058     {
0059         typedef typename apply_wrap1<
0060               advance_backward<BOOST_MPL_LIMIT_UNROLLING>
0061             , Iterator
0062             >::type chunk_result_;
0063 
0064         typedef typename apply_wrap1<
0065               advance_backward<(
0066                 (N - BOOST_MPL_LIMIT_UNROLLING) < 0
0067                     ? 0
0068                     : N - BOOST_MPL_LIMIT_UNROLLING
0069                     )>
0070             , chunk_result_
0071             >::type type;
0072     };
0073 };
0074 
0075 }}}
0076 
0077 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
0078 #endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
0079 
0080 ///// iteration, depth == 1
0081 
0082 // For gcc 4.4 compatability, we must include the
0083 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
0084 #else // BOOST_PP_IS_ITERATING
0085 #if BOOST_PP_ITERATION_DEPTH() == 1
0086 #define i_ BOOST_PP_FRAME_ITERATION(1)
0087 
0088 template<>
0089 struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
0090 {
0091     template< typename Iterator > struct apply
0092     {
0093         typedef Iterator iter0;
0094 
0095 #if i_ > 0
0096 #   define BOOST_PP_ITERATION_PARAMS_2 \
0097     (3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
0098 #   include BOOST_PP_ITERATE()
0099 #endif
0100 
0101         typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
0102     };
0103 
0104 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
0105     /// ETI workaround
0106     template<> struct apply<int>
0107     {
0108         typedef int type;
0109     };
0110 #endif
0111 };
0112 
0113 #undef i_
0114 
0115 ///// iteration, depth == 2
0116 
0117 #elif BOOST_PP_ITERATION_DEPTH() == 2
0118 
0119 #   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
0120 #   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
0121 
0122         typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
0123         
0124 #   undef AUX778076_ITER_1
0125 #   undef AUX778076_ITER_0
0126 
0127 #endif // BOOST_PP_ITERATION_DEPTH()
0128 #endif // BOOST_PP_IS_ITERATING