bind_function_object.hpp 2.4 KB

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