/Src/Dependencies/Boost/boost/spirit/home/phoenix/bind/detail/bind_function_object.hpp

http://hadesmem.googlecode.com/ · C++ Header · 43 lines · 23 code · 9 blank · 11 comment · 0 complexity · 919a12d652739b686f177a3fd8ac65e1 MD5 · raw file

  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 !defined(BOOST_PP_IS_ITERATING)
  7. #if !defined(PHOENIX_BIND_DETAIL_BIND_FUNCTION_OBJECT_HPP)
  8. #define PHOENIX_BIND_DETAIL_BIND_FUNCTION_OBJECT_HPP
  9. #include <boost/preprocessor/iterate.hpp>
  10. #include <boost/preprocessor/dec.hpp>
  11. #include <boost/preprocessor/repetition/enum_params.hpp>
  12. #include <boost/preprocessor/repetition/enum_binary_params.hpp>
  13. #define BOOST_PP_ITERATION_PARAMS_1 \
  14. (3, (3, BOOST_PP_DEC(PHOENIX_COMPOSITE_LIMIT), \
  15. "boost/spirit/home/phoenix/bind/detail/bind_function_object.hpp"))
  16. #include BOOST_PP_ITERATE()
  17. #endif
  18. ///////////////////////////////////////////////////////////////////////////////
  19. //
  20. // Preprocessor vertical repetition code
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. #else // defined(BOOST_PP_IS_ITERATING)
  24. #define N BOOST_PP_ITERATION()
  25. template <typename F, BOOST_PP_ENUM_PARAMS(N, typename A)>
  26. inline actor<typename as_composite<detail::function_eval<N>, F
  27. , BOOST_PP_ENUM_PARAMS(N, A)>::type>
  28. bind(F const& f, BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& _))
  29. {
  30. return compose<detail::function_eval<N> >(f, BOOST_PP_ENUM_PARAMS(N, _));
  31. }
  32. #undef N
  33. #endif // defined(BOOST_PP_IS_ITERATING)