BVB Source Codes

mars Show advance_backward.hpp Source code

Return Download mars: download advance_backward.hpp Source code - Download mars Source code - Type:.hpp
  1.  
  2. #if !defined(BOOST_PP_IS_ITERATING)
  3.  
  4. ///// header body
  5.  
  6. #ifndef BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
  7. #define BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
  8.  
  9. // Copyright Aleksey Gurtovoy 2000-2004
  10. //
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // (See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt)
  14. //
  15. // See http://www.boost.org/libs/mpl for documentation.
  16.  
  17. // $Id$
  18. // $Date$
  19. // $Revision$
  20.  
  21. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  22. #   include <boost/mpl/prior.hpp>
  23. #   include <boost/mpl/apply_wrap.hpp>
  24. #endif
  25.  
  26. #include <boost/mpl/aux_/config/use_preprocessed.hpp>
  27.  
  28. #if    !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
  29.     && !defined(BOOST_MPL_PREPROCESSING_MODE)
  30.  
  31. #   define BOOST_MPL_PREPROCESSED_HEADER advance_backward.hpp
  32. #   include <boost/mpl/aux_/include_preprocessed.hpp>
  33.  
  34. #else
  35.  
  36. #   include <boost/mpl/limits/unrolling.hpp>
  37. #   include <boost/mpl/aux_/nttp_decl.hpp>
  38. #   include <boost/mpl/aux_/config/eti.hpp>
  39.  
  40. #   include <boost/preprocessor/iterate.hpp>
  41. #   include <boost/preprocessor/cat.hpp>
  42. #   include <boost/preprocessor/inc.hpp>
  43.  
  44. namespace mars_boost {} namespace boost = mars_boost; namespace mars_boost { namespace mpl { namespace aux {
  45.  
  46. // forward declaration
  47. template< BOOST_MPL_AUX_NTTP_DECL(long, N) > struct advance_backward;
  48.  
  49. #   define BOOST_PP_ITERATION_PARAMS_1 \
  50.     (3,(0, BOOST_MPL_LIMIT_UNROLLING, <boost/mpl/aux_/advance_backward.hpp>))
  51. #   include BOOST_PP_ITERATE()
  52.  
  53. // implementation for N that exceeds BOOST_MPL_LIMIT_UNROLLING
  54. template< BOOST_MPL_AUX_NTTP_DECL(long, N) >
  55. struct advance_backward
  56. {
  57.     template< typename Iterator > struct apply
  58.     {
  59.         typedef typename apply_wrap1<
  60.               advance_backward<BOOST_MPL_LIMIT_UNROLLING>
  61.             , Iterator
  62.             >::type chunk_result_;
  63.  
  64.         typedef typename apply_wrap1<
  65.               advance_backward<(
  66.                 (N - BOOST_MPL_LIMIT_UNROLLING) < 0
  67.                     ? 0
  68.                     : N - BOOST_MPL_LIMIT_UNROLLING
  69.                     )>
  70.             , chunk_result_
  71.             >::type type;
  72.     };
  73. };
  74.  
  75. }}}
  76.  
  77. #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  78. #endif // BOOST_MPL_AUX778076_ADVANCE_BACKWARD_HPP_INCLUDED
  79.  
  80. ///// iteration, depth == 1
  81.  
  82. // For gcc 4.4 compatability, we must include the
  83. // BOOST_PP_ITERATION_DEPTH test inside an #else clause.
  84. #else // BOOST_PP_IS_ITERATING
  85. #if BOOST_PP_ITERATION_DEPTH() == 1
  86. #define i_ BOOST_PP_FRAME_ITERATION(1)
  87.  
  88. template<>
  89. struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
  90. {
  91.     template< typename Iterator > struct apply
  92.     {
  93.         typedef Iterator iter0;
  94.  
  95. #if i_ > 0
  96. #   define BOOST_PP_ITERATION_PARAMS_2 \
  97.     (3,(1, BOOST_PP_FRAME_ITERATION(1), <boost/mpl/aux_/advance_backward.hpp>))
  98. #   include BOOST_PP_ITERATE()
  99. #endif
  100.  
  101.         typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
  102.     };
  103.  
  104. #if defined(BOOST_MPL_CFG_MSVC_60_ETI_BUG)
  105.     /// ETI workaround
  106.     template<> struct apply<int>
  107.     {
  108.         typedef int type;
  109.     };
  110. #endif
  111. };
  112.  
  113. #undef i_
  114.  
  115. ///// iteration, depth == 2
  116.  
  117. #elif BOOST_PP_ITERATION_DEPTH() == 2
  118.  
  119. #   define AUX778076_ITER_0 BOOST_PP_CAT(iter,BOOST_PP_DEC(BOOST_PP_FRAME_ITERATION(2)))
  120. #   define AUX778076_ITER_1 BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(2))
  121.  
  122.         typedef typename prior<AUX778076_ITER_0>::type AUX778076_ITER_1;
  123.        
  124. #   undef AUX778076_ITER_1
  125. #   undef AUX778076_ITER_0
  126.  
  127. #endif // BOOST_PP_ITERATION_DEPTH()
  128. #endif // BOOST_PP_IS_ITERATING
  129.  
downloadadvance_backward.hpp Source code - Download mars Source code
Related Source Codes/Software:
Hero - Elegant transition library for iOS & tvOS 2017-06-09
deep-photo-styletransfer - Code and data for paper "Deep Photo Style Transfer... 2017-06-09
mastodon - A GNU Social-compatible microblogging server ... 2017-06-09
plyr - A simple HTML5, YouTube and Vimeo player ... 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
Public-APIs - 2017-06-09
lottie-ios - An iOS library to natively render After Effects ve... 2017-06-09
Awesome-Hacking - A collection of various awesome lists for hackers,... 2017-06-09
algorithms - Minimal examples of data structures and algorithms... 2017-06-10
lectures - Oxford Deep NLP 2017 course 2017-06-10
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top