make_expr_funop.hpp 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/detail/preprocessed/make_expr_funop.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  5. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_funop.hpp")
  6. #endif
  7. ///////////////////////////////////////////////////////////////////////////////
  8. /// \file make_expr_funop.hpp
  9. /// Contains definition of make_expr\<\>::operator() member functions.
  10. //
  11. // Copyright 2008 Eric Niebler. Distributed under the Boost
  12. // Software License, Version 1.0. (See accompanying file
  13. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  14. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  15. #pragma wave option(preserve: 1)
  16. #endif
  17. #define BOOST_PP_ITERATION_PARAMS_1 \
  18. (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_funop.hpp>))
  19. #include BOOST_PP_ITERATE()
  20. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  21. #pragma wave option(output: null)
  22. #endif
  23. #else // BOOST_PP_IS_ITERATING
  24. #define N BOOST_PP_ITERATION()
  25. template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
  26. struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
  27. {
  28. typedef
  29. typename result_of::make_expr<
  30. Tag
  31. , Domain
  32. BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
  33. >::type
  34. type;
  35. };
  36. /// \overload
  37. ///
  38. template<BOOST_PP_ENUM_PARAMS(N, typename A)>
  39. BOOST_FORCEINLINE
  40. typename result_of::make_expr<
  41. Tag
  42. , Domain
  43. BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  44. >::type const
  45. operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
  46. {
  47. return proto::detail::make_expr_<
  48. Tag
  49. , Domain
  50. BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  51. >()(BOOST_PP_ENUM_PARAMS(N, a));
  52. }
  53. #undef N
  54. #endif