BVB Source Codes

mars Show count_args.hpp Source code

Return Download mars: download count_args.hpp Source code - Download mars Source code - Type:.hpp
  1.  
  2. // NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
  3.  
  4. // Copyright Aleksey Gurtovoy 2000-2004
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // (See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt)
  9. //
  10. // See http://www.boost.org/libs/mpl for documentation.
  11.  
  12. // $Id$
  13. // $Date$
  14. // $Revision$
  15.  
  16. #include <boost/preprocessor/expr_if.hpp>
  17. #include <boost/preprocessor/inc.hpp>
  18. #include <boost/preprocessor/cat.hpp>
  19.  
  20. #if !defined(AUX778076_COUNT_ARGS_PARAM_NAME)
  21. #   define AUX778076_COUNT_ARGS_PARAM_NAME T
  22. #endif
  23.  
  24. #if !defined(AUX778076_COUNT_ARGS_TEMPLATE_PARAM)
  25. #   define AUX778076_COUNT_ARGS_TEMPLATE_PARAM typename AUX778076_COUNT_ARGS_PARAM_NAME
  26. #endif
  27.  
  28. // local macros, #undef-ined at the end of the header
  29.  
  30. #if !defined(AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES)
  31.  
  32. #   include <boost/mpl/aux_/preprocessor/repeat.hpp>
  33. #   include <boost/mpl/aux_/preprocessor/params.hpp>
  34.  
  35. #   define AUX778076_COUNT_ARGS_REPEAT BOOST_MPL_PP_REPEAT
  36. #   define AUX778076_COUNT_ARGS_PARAMS(param) \
  37.     BOOST_MPL_PP_PARAMS( \
  38.           AUX778076_COUNT_ARGS_ARITY \
  39.         , param \
  40.         ) \
  41.     /**/
  42.  
  43. #else
  44.  
  45. #   include <boost/preprocessor/enum_shifted_params.hpp>
  46. #   include <boost/preprocessor/repeat.hpp>
  47. #   include <boost/preprocessor/inc.hpp>
  48.  
  49. #   define AUX778076_COUNT_ARGS_REPEAT BOOST_PP_REPEAT
  50. #   define AUX778076_COUNT_ARGS_PARAMS(param) \
  51.     BOOST_PP_ENUM_SHIFTED_PARAMS( \
  52.           BOOST_PP_INC(AUX778076_COUNT_ARGS_ARITY) \
  53.         , param \
  54.         ) \
  55.     /**/
  56.  
  57. #endif // AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES
  58.  
  59.  
  60. #define AUX778076_IS_ARG_TEMPLATE_NAME \
  61.     BOOST_PP_CAT(is_,BOOST_PP_CAT(AUX778076_COUNT_ARGS_PREFIX,_arg)) \
  62. /**/
  63.  
  64. #define AUX778076_COUNT_ARGS_FUNC(unused, i, param) \
  65.     BOOST_PP_EXPR_IF(i, +) \
  66.     AUX778076_IS_ARG_TEMPLATE_NAME<BOOST_PP_CAT(param,BOOST_PP_INC(i))>::value \
  67. /**/
  68.  
  69. // is_<xxx>_arg
  70. template< AUX778076_COUNT_ARGS_TEMPLATE_PARAM >
  71. struct AUX778076_IS_ARG_TEMPLATE_NAME
  72. {
  73.     BOOST_STATIC_CONSTANT(bool, value = true);
  74. };
  75.  
  76. template<>
  77. struct AUX778076_IS_ARG_TEMPLATE_NAME<AUX778076_COUNT_ARGS_DEFAULT>
  78. {
  79.     BOOST_STATIC_CONSTANT(bool, value = false);
  80. };
  81.  
  82. // <xxx>_count_args
  83. template<
  84.       AUX778076_COUNT_ARGS_PARAMS(AUX778076_COUNT_ARGS_TEMPLATE_PARAM)
  85.     >
  86. struct BOOST_PP_CAT(AUX778076_COUNT_ARGS_PREFIX,_count_args)
  87. {
  88.     BOOST_STATIC_CONSTANT(int, value = AUX778076_COUNT_ARGS_REPEAT(
  89.           AUX778076_COUNT_ARGS_ARITY
  90.         , AUX778076_COUNT_ARGS_FUNC
  91.         , AUX778076_COUNT_ARGS_PARAM_NAME
  92.         ));
  93. };
  94.  
  95. #undef AUX778076_COUNT_ARGS_FUNC
  96. #undef AUX778076_IS_ARG_TEMPLATE_NAME
  97. #undef AUX778076_COUNT_ARGS_PARAMS
  98. #undef AUX778076_COUNT_ARGS_REPEAT
  99.  
  100. #undef AUX778076_COUNT_ARGS_ARITY
  101. #undef AUX778076_COUNT_ARGS_DEFAULT
  102. #undef AUX778076_COUNT_ARGS_PREFIX
  103. #undef AUX778076_COUNT_ARGS_USE_STANDARD_PP_PRIMITIVES
  104. #undef AUX778076_COUNT_ARGS_TEMPLATE_PARAM
  105. #undef AUX778076_COUNT_ARGS_PARAM_NAME
  106.  
downloadcount_args.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