|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2008-05-21 18:40:09
Author: eric_niebler
Date: 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
New Revision: 45630
URL: http://svn.boost.org/trac/boost/changeset/45630
Log:
bind, casts, construct, new, delete hold child expressions by reference
Text files modified:
branches/proto/v4/boost/phoenix/bind/bind.hpp | 74 ++++++++++++++++++++++-----------------
branches/proto/v4/boost/phoenix/object/const_cast.hpp | 14 +++----
branches/proto/v4/boost/phoenix/object/dynamic_cast.hpp | 14 +++----
branches/proto/v4/boost/phoenix/object/reinterpret_cast.hpp | 14 +++----
branches/proto/v4/boost/phoenix/object/static_cast.hpp | 14 +++----
5 files changed, 65 insertions(+), 65 deletions(-)
Modified: branches/proto/v4/boost/phoenix/bind/bind.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/bind/bind.hpp (original)
+++ branches/proto/v4/boost/phoenix/bind/bind.hpp 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
@@ -11,20 +11,32 @@
#include <boost/preprocessor.hpp>
#include <boost/mpl/if.hpp>
+ #include <boost/mpl/and.hpp>
+ #include <boost/mpl/not.hpp>
#include <boost/proto/proto.hpp>
#include <boost/phoenix/core/actor.hpp>
+ #include <boost/phoenix/core/reference.hpp>
#include <boost/type_traits/is_member_pointer.hpp>
namespace boost { namespace phoenix
{
+ namespace detail
+ {
+ template<typename Fun, typename T>
+ struct by_ref
+ : mpl::and_<
+ is_member_pointer<Fun>
+ , mpl::not_<proto::is_expr<T> >
+ >
+ {};
+ }
+
template<typename Fun>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , Fun
- >::type
- > const
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , Fun const &
+ >::type const
bind(Fun const &fun)
{
return proto::implicit_expr(fun);
@@ -48,20 +60,18 @@
BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
BOOST_PP_ENUM_SHIFTED_PARAMS(N, typename A)
>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , Fun
- , typename mpl::if_<
- is_member_pointer<Fun>
- , A0 &
- , A0
- >::type
- BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
- BOOST_PP_ENUM_SHIFTED_PARAMS(N, A)
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , Fun const &
+ , typename mpl::if_<
+ detail::by_ref<Fun, A0>
+ , actor<typename proto::terminal<A0 &>::type>
+ , A0 &
>::type
- > const
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
+ BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ >::type const
bind(
Fun const &fun
, A0 &a0
@@ -78,20 +88,18 @@
BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
BOOST_PP_ENUM_SHIFTED_PARAMS(N, typename A)
>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , Fun
- , typename mpl::if_<
- is_member_pointer<Fun>
- , A0 const &
- , A0
- >::type
- BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
- BOOST_PP_ENUM_SHIFTED_PARAMS(N, A)
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , Fun const &
+ , typename mpl::if_<
+ detail::by_ref<Fun, A0>
+ , actor<typename proto::terminal<A0 const &>::type>
+ , A0 const &
>::type
- > const
+ BOOST_PP_COMMA_IF(BOOST_PP_DEC(N))
+ BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(N, A, const & BOOST_PP_INTERCEPT)
+ >::type const
bind(
Fun const &fun
, A0 const &a0
Modified: branches/proto/v4/boost/phoenix/object/const_cast.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/object/const_cast.hpp (original)
+++ branches/proto/v4/boost/phoenix/object/const_cast.hpp 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
@@ -30,14 +30,12 @@
}
template<typename T, typename U>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , detail::const_cast_<T>
- , U
- >::type
- > const
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , detail::const_cast_<T>
+ , U const &
+ >::type const
const_cast_(U const &u)
{
detail::const_cast_<T> cast;
Modified: branches/proto/v4/boost/phoenix/object/dynamic_cast.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/object/dynamic_cast.hpp (original)
+++ branches/proto/v4/boost/phoenix/object/dynamic_cast.hpp 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
@@ -30,14 +30,12 @@
}
template<typename T, typename U>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , detail::dynamic_cast_<T>
- , U
- >::type
- > const
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , detail::dynamic_cast_<T>
+ , U const &
+ >::type const
dynamic_cast_(U const &u)
{
detail::dynamic_cast_<T> cast;
Modified: branches/proto/v4/boost/phoenix/object/reinterpret_cast.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/object/reinterpret_cast.hpp (original)
+++ branches/proto/v4/boost/phoenix/object/reinterpret_cast.hpp 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
@@ -30,14 +30,12 @@
}
template<typename T, typename U>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , detail::reinterpret_cast_<T>
- , U
- >::type
- > const
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , detail::reinterpret_cast_<T>
+ , U const &
+ >::type const
reinterpret_cast_(U const &u)
{
detail::reinterpret_cast_<T> cast;
Modified: branches/proto/v4/boost/phoenix/object/static_cast.hpp
==============================================================================
--- branches/proto/v4/boost/phoenix/object/static_cast.hpp (original)
+++ branches/proto/v4/boost/phoenix/object/static_cast.hpp 2008-05-21 18:40:08 EDT (Wed, 21 May 2008)
@@ -30,14 +30,12 @@
}
template<typename T, typename U>
- actor<
- typename proto::result_of::make_expr<
- proto::tag::function
- , proto::default_domain
- , detail::static_cast_<T>
- , U
- >::type
- > const
+ typename proto::result_of::make_expr<
+ proto::tag::function
+ , detail::domain
+ , detail::static_cast_<T>
+ , U const &
+ >::type const
static_cast_(U const &u)
{
detail::static_cast_<T> cast;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk