]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/phoenix/include/boost/phoenix/stl/cmath.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / phoenix / include / boost / phoenix / stl / cmath.hpp
CommitLineData
7c673cae
FG
1/*==============================================================================
2 Copyright (c) 2011 Steven Watanabe
3
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6==============================================================================*/
7
8#ifndef BOOST_PHOENIX_CMATH_HPP_INCLUDED
9#define BOOST_PHOENIX_CMATH_HPP_INCLUDED
10
11#include <boost/phoenix/core/limits.hpp>
12#include <cmath>
13#include <boost/phoenix/function/adapt_callable.hpp>
14#include <boost/type_traits/declval.hpp>
15#include <boost/phoenix/support/iterate.hpp>
16
17namespace boost {
18
19#if (defined (BOOST_NO_CXX11_DECLTYPE) || \
20 defined (BOOST_INTEL_CXX_VERSION) || \
21 (BOOST_GCC_VERSION < 40500) )
22#define BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
23 typename proto::detail::uncvref<A0>::type
24#else
25#define BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
26 decltype(name(BOOST_PP_ENUM_BINARY_PARAMS( \
27 n \
28 , boost::declval<typename proto::detail::uncvref<A \
29 , >::type>() BOOST_PP_INTERCEPT)))
30#endif
31#define BOOST_PHOENIX_MATH_FUNCTION(name, n) \
32 namespace phoenix_impl { \
33 struct name ## _impl { \
34 template<class Sig> \
35 struct result; \
36 template<class This, BOOST_PHOENIX_typename_A(n)> \
37 struct result<This(BOOST_PHOENIX_A(n))> \
38 { \
39 typedef \
40 BOOST_PHOENIX_MATH_FUNCTION_RESULT_TYPE(name, n) \
41 type; \
42 }; \
43 template<BOOST_PHOENIX_typename_A(n)> \
44 typename result<name ## _impl(BOOST_PHOENIX_A(n))>::type \
45 operator()(BOOST_PHOENIX_A_const_ref_a(n)) const { \
46 using namespace std; \
47 return name(BOOST_PHOENIX_a(n)); \
48 } \
49 }; \
50 } \
51 namespace phoenix { \
52 BOOST_PHOENIX_ADAPT_CALLABLE(name, phoenix_impl::name ## _impl, n) \
53 }
54
55BOOST_PHOENIX_MATH_FUNCTION(acos, 1)
56BOOST_PHOENIX_MATH_FUNCTION(asin, 1)
57BOOST_PHOENIX_MATH_FUNCTION(atan, 1)
58BOOST_PHOENIX_MATH_FUNCTION(atan2, 2)
59BOOST_PHOENIX_MATH_FUNCTION(ceil, 1)
60BOOST_PHOENIX_MATH_FUNCTION(cos, 1)
61BOOST_PHOENIX_MATH_FUNCTION(cosh, 1)
62BOOST_PHOENIX_MATH_FUNCTION(exp, 1)
63BOOST_PHOENIX_MATH_FUNCTION(fabs, 1)
64BOOST_PHOENIX_MATH_FUNCTION(floor, 1)
65BOOST_PHOENIX_MATH_FUNCTION(fmod, 2)
66BOOST_PHOENIX_MATH_FUNCTION(frexp, 2)
67BOOST_PHOENIX_MATH_FUNCTION(ldexp, 2)
68BOOST_PHOENIX_MATH_FUNCTION(log, 1)
69BOOST_PHOENIX_MATH_FUNCTION(log10, 1)
70BOOST_PHOENIX_MATH_FUNCTION(modf, 2)
71BOOST_PHOENIX_MATH_FUNCTION(pow, 2)
72BOOST_PHOENIX_MATH_FUNCTION(sin, 1)
73BOOST_PHOENIX_MATH_FUNCTION(sinh, 1)
74BOOST_PHOENIX_MATH_FUNCTION(sqrt, 1)
75BOOST_PHOENIX_MATH_FUNCTION(tan, 1)
76BOOST_PHOENIX_MATH_FUNCTION(tanh, 1)
77
78#undef BOOST_PHOENIX_MATH_FUNCTION
79
80}
81
82#endif