]> AND Private Git Repository - canny.git/blob - stc/exp/ml_stc_linux_make_v1.0/include/boost/mpl/aux_/advance_forward.hpp
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
58b2a7629787991143e86a4ce266d5fcc92ae748
[canny.git] / stc / exp / ml_stc_linux_make_v1.0 / include / boost / mpl / aux_ / advance_forward.hpp
1 \r
2 #if !defined(BOOST_PP_IS_ITERATING)\r
3 \r
4 ///// header body\r
5 \r
6 #ifndef BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED\r
7 #define BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED\r
8 \r
9 // Copyright Aleksey Gurtovoy 2000-2004\r
10 //\r
11 // Distributed under the Boost Software License, Version 1.0. \r
12 // (See accompanying file LICENSE_1_0.txt or copy at \r
13 // http://www.boost.org/LICENSE_1_0.txt)\r
14 //\r
15 // See http://www.boost.org/libs/mpl for documentation.\r
16 \r
17 // $Id: advance_forward.hpp 49267 2008-10-11 06:19:02Z agurtovoy $\r
18 // $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $\r
19 // $Revision: 49267 $\r
20 \r
21 #if !defined(BOOST_MPL_PREPROCESSING_MODE)\r
22 #   include <boost/mpl/next.hpp>\r
23 #   include <boost/mpl/apply_wrap.hpp>\r
24 #endif\r
25 \r
26 #include <boost/mpl/aux_/config/use_preprocessed.hpp>\r
27 \r
28 #if    !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \\r
29     && !defined(BOOST_MPL_PREPROCESSING_MODE)\r
30 \r
31 #   define BOOST_MPL_PREPROCESSED_HEADER advance_forward.hpp\r
32 #   include <boost/mpl/aux_/include_preprocessed.hpp>\r
33 \r
34 #else\r
35 \r
36 #   include <boost/mpl/limits/unrolling.hpp>\r
37 #   include <boost/mpl/aux_/nttp_decl.hpp>\r
38 #   include <boost/mpl/aux_/config/eti.hpp>\r
39 \r
40 #   include <boost/preprocessor/iterate.hpp>\r
41 #   include <boost/preprocessor/cat.hpp>\r
42 #   include <boost/preprocessor/inc.hpp>\r
43 \r
44 namespace boost { namespace mpl { namespace aux {\r
45 \r
46 // forward declaration\r
47 template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_forward;\r
48 \r
49 #   define BOOST_PP_ITERATION_PARAMS_1 \\r
50     (3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_forward.hpp>))\r
51 #   include BOOST_PP_ITERATE()\r
52 \r
53 // implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING\r
54 template< BOOST_MPL_AUX_NTTP_DECL(long, N) > \r
55 struct advance_forward\r
56 {\r
57     template< typename Iterator > struct apply\r
58     {\r
59         typedef typename apply_wrap1<\r
60               advance_forward<BOOST_MPL_LIMIT_UNROLLING>\r
61             , Iterator\r
62             >::type chunk_result_;\r
63 \r
64         typedef typename apply_wrap1<\r
65               advance_forward<(\r
66                 (N - BOOST_MPL_LIMIT_UNROLLING) < 0\r
67                     ? 0\r
68                     : N - BOOST_MPL_LIMIT_UNROLLING\r
69                     )>\r
70             , chunk_result_\r
71             >::type type;\r
72     };\r
73 };\r
74 \r
75 }}}\r
76 \r
77 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS\r
78 #endif // BOOST_MPL_AUX_ADVANCE_FORWARD_HPP_INCLUDED\r
79 \r
80 ///// iteration, depth == 1\r
81 \r
82 // For gcc 4.4 compatability, we must include the\r
83 // BOOST_PP_ITERATION_DEPTH test inside an #else clause.\r
84 #else // BOOST_PP_IS_ITERATING\r
85 #if BOOST_PP_ITERATION_DEPTH() == 1\r
86 #define i_ BOOST_PP_FRAME_ITERATION(1)\r
87 \r
88 template<>\r
89 struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >\r
90 {\r
91     template< typename Iterator > struct apply\r
92     {\r
93         typedef Iterator iter0;\r
94 \r
95 #if i_ > 0\r
96 #   define BOOST_PP_ITERATION_PARAMS_2 \\r
97     (3,(1, i_, <boost/mpl/aux_/advance_forward.hpp>))\r
98 #   include BOOST_PP_ITERATE()\r
99 #endif\r
100         typedef BOOST_PP_CAT(iter,i_) type;\r
101     };\r
102 \r
103 #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)\r
104     /// ETI workaround\r
105     template<> struct apply<int>\r
106     {\r
107         typedef int type;\r
108     };\r
109 #endif\r
110 };\r
111 \r
112 #undef i_\r
113 \r
114 ///// iteration, depth == 2\r
115 \r
116 #elif BOOST_PP_ITERATION_DEPTH() == 2\r
117 \r
118 #   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))\r
119 #   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))\r
120 \r
121         typedef typename next<AUX778076_ITER_0>::type AUX778076_ITER_1;\r
122         \r
123 #   undef AUX778076_ITER_1\r
124 #   undef AUX778076_ITER_0\r
125 \r
126 #endif // BOOST_PP_ITERATION_DEPTH()\r
127 #endif // BOOST_PP_IS_ITERATING\r