placeholders.hpp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #if !defined(BOOST_PP_IS_ITERATING)
  2. ///// header body
  3. #ifndef BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
  4. #define BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
  5. // Copyright Aleksey Gurtovoy 2001-2004
  6. // Copyright Peter Dimov 2001-2003
  7. //
  8. // Distributed under the Boost Software License, Version 1.0.
  9. // (See accompanying file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. //
  12. // See http://www.boost.org/libs/mpl for documentation.
  13. // $Id$
  14. // $Date$
  15. // $Revision$
  16. #if !defined(BOOST_MPL_PREPROCESSING_MODE)
  17. # include <boost/mpl/arg.hpp>
  18. # include <boost/mpl/aux_/adl_barrier.hpp>
  19. # if !defined(BOOST_MPL_CFG_NO_ADL_BARRIER_NAMESPACE)
  20. # define BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(type) \
  21. using ::BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::type; \
  22. /**/
  23. # else
  24. # define BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(type) /**/
  25. # endif
  26. #endif
  27. #include <boost/mpl/aux_/config/use_preprocessed.hpp>
  28. #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
  29. && !defined(BOOST_MPL_PREPROCESSING_MODE)
  30. # define BOOST_MPL_PREPROCESSED_HEADER placeholders.hpp
  31. # include <boost/mpl/aux_/include_preprocessed.hpp>
  32. #else
  33. # include <boost/mpl/aux_/nttp_decl.hpp>
  34. # include <boost/mpl/limits/arity.hpp>
  35. # include <boost/preprocessor/iterate.hpp>
  36. # include <boost/preprocessor/cat.hpp>
  37. // watch out for GNU gettext users, who #define _(x)
  38. #if !defined(_) || defined(BOOST_MPL_CFG_NO_UNNAMED_PLACEHOLDER_SUPPORT)
  39. BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
  40. typedef arg<-1> _;
  41. BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
  42. namespace boost { namespace mpl {
  43. BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(_)
  44. namespace placeholders {
  45. using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::_;
  46. }
  47. }}
  48. #endif
  49. /// agurt, 17/mar/02: one more placeholder for the last 'apply#'
  50. /// specialization
  51. #define BOOST_PP_ITERATION_PARAMS_1 \
  52. (3,(1, BOOST_MPL_LIMIT_METAFUNCTION_ARITY + 1, <boost/mpl/placeholders.hpp>))
  53. #include BOOST_PP_ITERATE()
  54. #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
  55. #endif // BOOST_MPL_PLACEHOLDERS_HPP_INCLUDED
  56. ///// iteration
  57. #else
  58. #define i_ BOOST_PP_FRAME_ITERATION(1)
  59. BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
  60. typedef arg<i_> BOOST_PP_CAT(_,i_);
  61. BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
  62. namespace boost { namespace mpl {
  63. BOOST_MPL_AUX_ARG_ADL_BARRIER_DECL(BOOST_PP_CAT(_,i_))
  64. namespace placeholders {
  65. using BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE::BOOST_PP_CAT(_,i_);
  66. }
  67. }}
  68. #undef i_
  69. #endif // BOOST_PP_IS_ITERATING