From 97229711bcea6d25601adf6159c98f5746b845d2 Mon Sep 17 00:00:00 2001 From: John Fletcher Date: Sun, 2 Feb 2014 17:49:13 +0000 Subject: [PATCH] include/boost/phoenix/stl/cmath.cpp Apply patch for C++11 use only. --- include/boost/phoenix/stl/cmath.hpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/include/boost/phoenix/stl/cmath.hpp b/include/boost/phoenix/stl/cmath.hpp index f7cef77..b7e72e5 100644 --- a/include/boost/phoenix/stl/cmath.hpp +++ b/include/boost/phoenix/stl/cmath.hpp @@ -16,6 +16,7 @@ namespace boost { +#ifdef BOOST_NO_CXX11_DECLTYPE #define BOOST_PHOENIX_MATH_FUNCTION(name, n) \ namespace phoenix_impl { \ struct name ## _impl { \ @@ -38,6 +39,30 @@ namespace boost { namespace phoenix { \ BOOST_PHOENIX_ADAPT_CALLABLE(name, phoenix_impl::name ## _impl, n) \ } +#else +#define BOOST_PHOENIX_MATH_FUNCTION(name, n) \ + namespace phoenix_impl { \ + struct name ## _impl { \ + template \ + struct result; \ + template \ + struct result \ + { \ + typedef \ + decltype( name(typename proto::detail::uncvref::type()) ) \ + type; \ + }; \ + template \ + auto operator()(BOOST_PHOENIX_A_const_ref_a(n)) const -> decltype( name(BOOST_PHOENIX_a(n)) ) { \ + using namespace std; \ + return name(BOOST_PHOENIX_a(n)); \ + } \ + }; \ + } \ + namespace phoenix { \ + BOOST_PHOENIX_ADAPT_CALLABLE(name, phoenix_impl::name ## _impl, n) \ + } +#endif BOOST_PHOENIX_MATH_FUNCTION(acos, 1) BOOST_PHOENIX_MATH_FUNCTION(asin, 1)