BVB Source Codes

mars Show for_each.hpp Source code

Return Download mars: download for_each.hpp Source code - Download mars Source code - Type:.hpp
  1. // Copyright Daniel Wallin 2005. Use, modification and distribution is
  2. // subject to the Boost Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4.  
  5. #ifndef BOOST_PARAMETER_FOR_EACH_051217_HPP
  6. # define BOOST_PARAMETER_FOR_EACH_051217_HPP
  7.  
  8. # include <boost/preprocessor/cat.hpp>
  9. # include <boost/preprocessor/detail/split.hpp>
  10. # include <boost/preprocessor/logical/not.hpp>
  11. # include <boost/preprocessor/facilities/is_empty.hpp>
  12. # include <boost/preprocessor/tuple/eat.hpp>
  13. # include <boost/preprocessor/arithmetic/inc.hpp>
  14. # include <boost/preprocessor/repeat.hpp>
  15. # include <boost/preprocessor/punctuation/comma_if.hpp>
  16. # include <boost/preprocessor/for.hpp>
  17. # include <boost/preprocessor/repetition/deduce_r.hpp>
  18.  
  19. # define BOOST_PARAMETER_FOR_EACH_head_aux2(x,y) (x,y), ~
  20. # define BOOST_PARAMETER_FOR_EACH_head_aux3(x,y,z) (x,y,z), ~
  21. # define BOOST_PARAMETER_FOR_EACH_head_aux4(x,y,z,u) (x,y,z,u), ~
  22. # define BOOST_PARAMETER_FOR_EACH_head(n,x) \
  23.     BOOST_PP_SPLIT(0, BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_head_aux,n) x)
  24.  
  25. # define BOOST_PARAMETER_FOR_EACH_pred_aux_BOOST_PARAMETER_FOR_EACH_END_SENTINEL
  26. # define BOOST_PARAMETER_FOR_EACH_pred_aux_check(x) \
  27.     BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
  28.         BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux_, x) \
  29.     )), ~
  30.  
  31. # define BOOST_PARAMETER_FOR_EACH_pred_aux2(x,y) \
  32.     BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
  33. # define BOOST_PARAMETER_FOR_EACH_pred_aux3(x,y,z) \
  34.     BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
  35. # define BOOST_PARAMETER_FOR_EACH_pred_aux4(x,y,z,u) \
  36.     BOOST_PARAMETER_FOR_EACH_pred_aux_check(x)
  37.  
  38. # define BOOST_PARAMETER_FOR_EACH_pred_aux0(n,x) \
  39.     BOOST_PP_CAT(BOOST_PARAMETER_FOR_EACH_pred_aux,n) x
  40.  
  41. # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
  42. #  define BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST(x) \
  43.     BOOST_PP_SPLIT(0, x)
  44.  
  45. #  define BOOST_PARAMETER_FOR_EACH_pred(r, state) \
  46.     BOOST_PARAMETER_FOR_EACH_pred_SPLIT_FIRST( \
  47.         BOOST_PARAMETER_FOR_EACH_pred_aux0( \
  48.             BOOST_PP_TUPLE_ELEM(5,3,state) \
  49.           , BOOST_PP_TUPLE_ELEM(5,0,state) \
  50.         ) \
  51.     )
  52. # else
  53. #  define BOOST_PARAMETER_FOR_EACH_pred(r, state) \
  54.     BOOST_PP_SPLIT( \
  55.         0 \
  56.       , BOOST_PARAMETER_FOR_EACH_pred_aux0( \
  57.             BOOST_PP_TUPLE_ELEM(5,3,state) \
  58.           , BOOST_PP_TUPLE_ELEM(5,0,state) \
  59.         ) \
  60.     )
  61. # endif
  62.  
  63. # define BOOST_PARAMETER_FOR_EACH_op(r, state) \
  64.     ( \
  65.         BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5,3,state)) \
  66.           BOOST_PP_TUPLE_ELEM(5,0,state) \
  67.       , BOOST_PP_TUPLE_ELEM(5,1,state) \
  68.       , BOOST_PP_TUPLE_ELEM(5,2,state) \
  69.       , BOOST_PP_TUPLE_ELEM(5,3,state) \
  70.       , BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5,4,state)) \
  71.     )
  72.  
  73. # define BOOST_PARAMETER_FOR_EACH_macro(r, state) \
  74.     BOOST_PP_TUPLE_ELEM(5,2,state)( \
  75.         r \
  76.       , BOOST_PP_TUPLE_ELEM(5,4,state) \
  77.       , BOOST_PARAMETER_FOR_EACH_head( \
  78.             BOOST_PP_TUPLE_ELEM(5,3,state) \
  79.           , BOOST_PP_TUPLE_ELEM(5,0,state) \
  80.         ) \
  81.       , BOOST_PP_TUPLE_ELEM(5,1,state) \
  82.     )
  83.  
  84. # define BOOST_PARAMETER_FOR_EACH_build_end_sentinel(z,n,text) \
  85.     BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_FOR_EACH_END_SENTINEL
  86. # define BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity) \
  87.     ( \
  88.         BOOST_PP_REPEAT(arity, BOOST_PARAMETER_FOR_EACH_build_end_sentinel, _) \
  89.     )
  90.  
  91. # define BOOST_PARAMETER_FOR_EACH_R(r, arity, list, data, macro) \
  92.     BOOST_PP_CAT(BOOST_PP_FOR_, r)( \
  93.         (list BOOST_PARAMETER_FOR_EACH_build_end_sentinel_tuple(arity), data, macro, arity, 0) \
  94.       , BOOST_PARAMETER_FOR_EACH_pred \
  95.       , BOOST_PARAMETER_FOR_EACH_op \
  96.       , BOOST_PARAMETER_FOR_EACH_macro \
  97.     )
  98.  
  99. # define BOOST_PARAMETER_FOR_EACH(arity, list, data, macro) \
  100.     BOOST_PARAMETER_FOR_EACH_R(BOOST_PP_DEDUCE_R(), arity, list, data, macro)
  101.  
  102. #endif // BOOST_PARAMETER_FOR_EACH_051217_HPP
  103.  
  104.  
downloadfor_each.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