bind_function_object.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*=============================================================================
  2. Copyright (c) 2001-2007 Joel de Guzman
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #if !BOOST_PHOENIX_IS_ITERATING
  7. #include <boost/phoenix/core/expression.hpp>
  8. #include <boost/phoenix/core/detail/function_eval.hpp>
  9. namespace boost { namespace phoenix {
  10. template <typename F>
  11. inline
  12. typename detail::expression::function_eval<F>::type const
  13. bind(F f)
  14. {
  15. return detail::expression::function_eval<F>::make(f);
  16. }
  17. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  18. #include <boost/phoenix/bind/detail/cpp03/preprocessed/bind_function_object.hpp>
  19. #else
  20. #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_function_object_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  22. #endif
  23. /*=============================================================================
  24. Copyright (c) 2001-2007 Joel de Guzman
  25. Distributed under the Boost Software License, Version 1.0. (See accompanying
  26. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  27. ==============================================================================*/
  28. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  29. #pragma wave option(preserve: 1)
  30. #endif
  31. #define BOOST_PHOENIX_ITERATION_PARAMS \
  32. (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \
  33. <boost/phoenix/bind/detail/cpp03/bind_function_object.hpp>))
  34. #include BOOST_PHOENIX_ITERATE()
  35. #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  36. #pragma wave option(output: null)
  37. #endif
  38. #endif
  39. }}
  40. #else
  41. template <
  42. typename F
  43. , BOOST_PHOENIX_typename_A
  44. >
  45. inline
  46. typename detail::expression::function_eval<
  47. F
  48. , BOOST_PHOENIX_A
  49. >::type const
  50. bind(F f, BOOST_PHOENIX_A_const_ref_a)
  51. {
  52. return
  53. detail::expression::function_eval<F, BOOST_PHOENIX_A>::make(
  54. f
  55. , BOOST_PHOENIX_a
  56. );
  57. }
  58. #endif