BVB Source Codes

mars Show flatten.hpp Source code

Return Download mars: download flatten.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_FLATTEN_051217_HPP
  6. # define BOOST_PARAMETER_FLATTEN_051217_HPP
  7.  
  8. # include <boost/preprocessor/tuple/elem.hpp>
  9. # include <boost/preprocessor/tuple/rem.hpp>
  10. # include <boost/preprocessor/cat.hpp>
  11. # include <boost/preprocessor/seq/for_each.hpp>
  12. # include <boost/preprocessor/seq/for_each_i.hpp>
  13. # include <boost/preprocessor/identity.hpp>
  14. # include <boost/preprocessor/selection/max.hpp>
  15. # include <boost/preprocessor/arithmetic/sub.hpp>
  16. # include <boost/preprocessor/repetition/enum_trailing.hpp>
  17. # include <boost/parameter/aux_/preprocessor/for_each.hpp>
  18.  
  19. # define BOOST_PARAMETER_FLATTEN_SPLIT_required required,
  20. # define BOOST_PARAMETER_FLATTEN_SPLIT_optional optional,
  21. # define BOOST_PARAMETER_FLATTEN_SPLIT_deduced deduced,
  22.  
  23. # define BOOST_PARAMETER_FLATTEN_SPLIT(sub) \
  24.     BOOST_PP_CAT(BOOST_PARAMETER_FLATTEN_SPLIT_, sub)
  25.  
  26. # define BOOST_PARAMETER_FLATTEN_QUALIFIER(sub) \
  27.     BOOST_PP_SPLIT(0, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
  28.  
  29. # define BOOST_PARAMETER_FLATTEN_ARGS(sub) \
  30.     BOOST_PP_SPLIT(1, BOOST_PARAMETER_FLATTEN_SPLIT(sub))
  31.  
  32. # define BOOST_PARAMETER_FLATTEN_ARITY_optional(arities) \
  33.     BOOST_PP_TUPLE_ELEM(3,0,arities)
  34.  
  35. # define BOOST_PARAMETER_FLATTEN_ARITY_required(arities) \
  36.     BOOST_PP_TUPLE_ELEM(3,1,arities)
  37.  
  38. # define BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
  39. # define BOOST_PARAMETER_FLATTEN_SPEC0(r, n, elem, data) \
  40.     (( \
  41.         BOOST_PP_TUPLE_ELEM(3,2,data) \
  42.       , BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3,0,data)) elem \
  43.         BOOST_PP_ENUM_TRAILING( \
  44.             BOOST_PP_SUB( \
  45.                 BOOST_PP_TUPLE_ELEM(3,1,data) \
  46.               , BOOST_PP_TUPLE_ELEM(3,0,data) \
  47.             ) \
  48.           , BOOST_PARAMETER_FLATTEN_SPEC0_DUMMY_ELEM \
  49.           , ~ \
  50.         ) \
  51.     ))
  52.  
  53. # define BOOST_PARAMETER_FLATTEN_SPEC_AUX(r, arity, max_arity, spec, transform) \
  54.     BOOST_PARAMETER_FOR_EACH_R( \
  55.         r \
  56.       , arity \
  57.       , BOOST_PARAMETER_FLATTEN_ARGS(spec) \
  58.       , (arity, max_arity, transform(BOOST_PARAMETER_FLATTEN_QUALIFIER(spec))) \
  59.       , BOOST_PARAMETER_FLATTEN_SPEC0 \
  60.     )
  61.  
  62. # define BOOST_PARAMETER_FLATTEN_IDENTITY(x) x
  63.  
  64. # define BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec) \
  65.     BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
  66.         r \
  67.       , BOOST_PP_CAT( \
  68.             BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
  69.         )(arities) \
  70.       , BOOST_PP_TUPLE_ELEM(3,2,arities) \
  71.       , spec \
  72.       , BOOST_PARAMETER_FLATTEN_IDENTITY \
  73.     )
  74.  
  75. # define BOOST_PARAMETER_FLATTEN_SPEC_required(r, arities, spec) \
  76.     BOOST_PARAMETER_FLATTEN_SPEC_optional(r, arities, spec)
  77.  
  78. # define BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED(x) BOOST_PP_CAT(deduced_,x)
  79.  
  80. # define BOOST_PARAMETER_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
  81.     BOOST_PARAMETER_FLATTEN_SPEC_AUX( \
  82.         r \
  83.       , BOOST_PP_CAT( \
  84.             BOOST_PARAMETER_FLATTEN_ARITY_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
  85.         )(arities) \
  86.       , BOOST_PP_TUPLE_ELEM(3,2,arities) \
  87.       , spec \
  88.       , BOOST_PARAMETER_FLATTEN_SPEC_AS_DEDUCED \
  89.     )
  90.  
  91. # define BOOST_PARAMETER_FLATTEN_SPEC_deduced(r, arities, spec) \
  92.     BOOST_PP_SEQ_FOR_EACH_I_R( \
  93.         r \
  94.       , BOOST_PARAMETER_FLATTEN_SPEC_deduced_M \
  95.       , arities \
  96.       , BOOST_PARAMETER_FLATTEN_ARGS(spec) \
  97.     )
  98.  
  99. # define BOOST_PARAMETER_FLATTEN_SPEC(r, arities, spec) \
  100.     BOOST_PP_CAT( \
  101.         BOOST_PARAMETER_FLATTEN_SPEC_, BOOST_PARAMETER_FLATTEN_QUALIFIER(spec) \
  102.     )(r, arities, spec)
  103.  
  104. # define BOOST_PARAMETER_FLATTEN(optional_arity, required_arity, wanted_arity, specs) \
  105.     BOOST_PP_SEQ_FOR_EACH( \
  106.         BOOST_PARAMETER_FLATTEN_SPEC \
  107.       , ( \
  108.             optional_arity, required_arity \
  109.           , wanted_arity \
  110.         ) \
  111.       , specs \
  112.     )
  113.  
  114. #endif // BOOST_PARAMETER_FLATTEN_051217_HPP
  115.  
  116.  
downloadflatten.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