bind_fwd.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #if !defined(BOOST_PP_IS_ITERATING)
  2. ///// header body
  3. #ifndef BOOST_MPL_BIND_FWD_HPP_INCLUDED
  4. #define BOOST_MPL_BIND_FWD_HPP_INCLUDED
  5. // Copyright Aleksey Gurtovoy 2000-2004
  6. //
  7. // Distributed under the Boost Software License, Version 1.0.
  8. // (See accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. //
  11. // See http://www.boost.org/libs/mpl for documentation.
  12. // $Id$
  13. // $Date$
  14. // $Revision$
  15. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  16. # include <boost/mpl/aux_/na.hpp>
  17. #endif
  18. #include <boost/mpl/aux_/config/bind.hpp>
  19. #include <boost/mpl/aux_/config/use_preprocessed.hpp>
  20. #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
  21. && !defined(BOOST_MPL_PREPROCESSING_MODE)
  22. # define BOOST_MPL_PREPROCESSED_HEADER bind_fwd.hpp
  23. # include <boost/mpl/aux_/include_preprocessed.hpp>
  24. #else
  25. # include <boost/mpl/limits/arity.hpp>
  26. # include <boost/mpl/aux_/preprocessor/params.hpp>
  27. # include <boost/mpl/aux_/preprocessor/default_params.hpp>
  28. # include <boost/mpl/aux_/config/dmc_ambiguous_ctps.hpp>
  29. # include <boost/preprocessor/comma_if.hpp>
  30. # include <boost/preprocessor/iterate.hpp>
  31. # include <boost/preprocessor/cat.hpp>
  32. namespace boost { namespace mpl {
  33. // local macros, #undef-ined at the end of the header
  34. # if defined(BOOST_MPL_CFG_DMC_AMBIGUOUS_CTPS)
  35. # define AUX778076_DMC_PARAM() , int dummy_ = 0
  36. # else
  37. # define AUX778076_DMC_PARAM()
  38. # endif
  39. # define AUX778076_BIND_DEFAULT_PARAMS(param, value) \
  40. BOOST_MPL_PP_DEFAULT_PARAMS( \
  41. BOOST_MPL_LIMIT_METAFUNCTION_ARITY \
  42. , param \
  43. , value \
  44. ) \
  45. AUX778076_DMC_PARAM() \
  46. /**/
  47. # define AUX778076_BIND_N_PARAMS(n, param) \
  48. BOOST_PP_COMMA_IF(n) BOOST_MPL_PP_PARAMS(n, param) \
  49. AUX778076_DMC_PARAM() \
  50. /**/
  51. #if !defined(BOOST_MPL_CFG_NO_BIND_TEMPLATE)
  52. template<
  53. typename F, AUX778076_BIND_DEFAULT_PARAMS(typename T, na)
  54. >
  55. struct bind;
  56. #endif
  57. #define BOOST_PP_ITERATION_PARAMS_1 \
  58. (3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/bind_fwd.hpp>))
  59. #include BOOST_PP_ITERATE()
  60. # undef AUX778076_BIND_N_PARAMS
  61. # undef AUX778076_BIND_DEFAULT_PARAMS
  62. # undef AUX778076_DMC_PARAM
  63. }}
  64. #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  65. #endif // BOOST_MPL_BIND_FWD_HPP_INCLUDED
  66. ///// iteration
  67. #else
  68. #define i_ BOOST_PP_FRAME_ITERATION(1)
  69. template<
  70. typename F AUX778076_BIND_N_PARAMS(i_, typename T)
  71. >
  72. struct BOOST_PP_CAT(bind,i_);
  73. #undef i_
  74. #endif // BOOST_PP_IS_ITERATING