File indexing completed on 2025-01-18 09:47:41
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_PHOENIX_CMATH_HPP_INCLUDED
0009 #define BOOST_PHOENIX_CMATH_HPP_INCLUDED
0010
0011 #include <boost/phoenix/core/limits.hpp>
0012 #include <cmath>
0013 #include <boost/phoenix/function/adapt_callable.hpp>
0014 #include <boost/type_traits/declval.hpp>
0015 #include <boost/phoenix/support/iterate.hpp>
0016
0017 namespace boost {
0018
0019 #if (defined (BOOST_NO_CXX11_DECLTYPE) || \
0020 defined (BOOST_INTEL_CXX_VERSION) || \
0021 (BOOST_GCC_VERSION < 40500) )
0022 #define BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
0023 typename proto::detail::uncvref<A0>::type
0024 #else
0025 #define BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
0026 decltype(name(BOOST_PP_ENUM_BINARY_PARAMS( \
0027 n \
0028 , boost::declval<typename proto::detail::uncvref<A \
0029 , >::type>() BOOST_PP_INTERCEPT)))
0030 #endif
0031 #define BOOST_PHOENIX_MATH_FUNCTION(name, n) \
0032 namespace phoenix_impl { \
0033 struct name ## _impl { \
0034 template<class Sig> \
0035 struct result; \
0036 template<class This, BOOST_PHOENIX_typename_A(n)> \
0037 struct result<This(BOOST_PHOENIX_A(n))> \
0038 { \
0039 typedef \
0040 BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
0041 type; \
0042 }; \
0043 template<BOOST_PHOENIX_typename_A(n)> \
0044 typename result<name ## _impl(BOOST_PHOENIX_A(n))>::type \
0045 operator()(BOOST_PHOENIX_A_const_ref_a(n)) const { \
0046 using namespace std; \
0047 return name(BOOST_PHOENIX_a(n)); \
0048 } \
0049 }; \
0050 } \
0051 namespace phoenix { \
0052 BOOST_PHOENIX_ADAPT_CALLABLE(name, phoenix_impl::name ## _impl, n) \
0053 }
0054
0055 BOOST_PHOENIX_MATH_FUNCTION(acos, 1)
0056 BOOST_PHOENIX_MATH_FUNCTION(asin, 1)
0057 BOOST_PHOENIX_MATH_FUNCTION(atan, 1)
0058 BOOST_PHOENIX_MATH_FUNCTION(atan2, 2)
0059 BOOST_PHOENIX_MATH_FUNCTION(ceil, 1)
0060 BOOST_PHOENIX_MATH_FUNCTION(cos, 1)
0061 BOOST_PHOENIX_MATH_FUNCTION(cosh, 1)
0062 BOOST_PHOENIX_MATH_FUNCTION(exp, 1)
0063 BOOST_PHOENIX_MATH_FUNCTION(fabs, 1)
0064 BOOST_PHOENIX_MATH_FUNCTION(floor, 1)
0065 BOOST_PHOENIX_MATH_FUNCTION(fmod, 2)
0066 BOOST_PHOENIX_MATH_FUNCTION(frexp, 2)
0067 BOOST_PHOENIX_MATH_FUNCTION(ldexp, 2)
0068 BOOST_PHOENIX_MATH_FUNCTION(log, 1)
0069 BOOST_PHOENIX_MATH_FUNCTION(log10, 1)
0070 BOOST_PHOENIX_MATH_FUNCTION(modf, 2)
0071 BOOST_PHOENIX_MATH_FUNCTION(pow, 2)
0072 BOOST_PHOENIX_MATH_FUNCTION(sin, 1)
0073 BOOST_PHOENIX_MATH_FUNCTION(sinh, 1)
0074 BOOST_PHOENIX_MATH_FUNCTION(sqrt, 1)
0075 BOOST_PHOENIX_MATH_FUNCTION(tan, 1)
0076 BOOST_PHOENIX_MATH_FUNCTION(tanh, 1)
0077
0078 #undef BOOST_PHOENIX_MATH_FUNCTION
0079
0080 }
0081
0082 #endif