expr_funop.hpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // expr1.hpp
  3. // Contains definition of expr\<\>::operator() overloads.
  4. //
  5. // Copyright 2008 Eric Niebler. Distributed under the Boost
  6. // Software License, Version 1.0. (See accompanying file
  7. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  8. #define N BOOST_PP_ITERATION()
  9. /// \overload
  10. ///
  11. template<BOOST_PP_ENUM_PARAMS(N, typename A)>
  12. BOOST_FORCEINLINE
  13. typename result_of::BOOST_PP_CAT(funop, N)<
  14. expr const
  15. , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  16. >::type const
  17. operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a)) const
  18. {
  19. return result_of::BOOST_PP_CAT(funop, N)<
  20. expr const
  21. , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  22. >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
  23. }
  24. #ifdef BOOST_PROTO_DEFINE_TERMINAL
  25. /// \overload
  26. ///
  27. template<BOOST_PP_ENUM_PARAMS(N, typename A)>
  28. BOOST_FORCEINLINE
  29. typename result_of::BOOST_PP_CAT(funop, N)<
  30. expr
  31. , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  32. >::type const
  33. operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const &a))
  34. {
  35. return result_of::BOOST_PP_CAT(funop, N)<
  36. expr
  37. , default_domain BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
  38. >::call(*this BOOST_PP_ENUM_TRAILING_PARAMS(N, a));
  39. }
  40. #endif
  41. #undef N