summaryrefslogtreecommitdiff
path: root/boost/phoenix/core/actor.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/phoenix/core/actor.hpp')
-rw-r--r--boost/phoenix/core/actor.hpp123
1 files changed, 3 insertions, 120 deletions
diff --git a/boost/phoenix/core/actor.hpp b/boost/phoenix/core/actor.hpp
index ade288d7c4..43b8e69bdd 100644
--- a/boost/phoenix/core/actor.hpp
+++ b/boost/phoenix/core/actor.hpp
@@ -75,65 +75,6 @@ namespace boost { namespace phoenix
{
typedef T const & type;
};
-
- struct do_assign
- {
- BOOST_PROTO_CALLABLE()
-
- typedef void result_type;
-
- template <typename T1, typename T2>
- void operator()(T1 & t1, T2 const & t2) const
- {
- proto::value(t1) = proto::value(t2);
- }
- };
-
-#ifdef BOOST_PHOENIX_NO_VARIADIC_ACTOR
- #include <boost/phoenix/core/detail/cpp03/assign.hpp>
-#else
- struct assign : proto::transform<assign>
- {
- typedef assign proto_grammer;
-
- template <typename Expr, typename State, typename Data
- , typename Indices = typename detail::make_index_sequence<proto::arity_of<Expr>::value>::type >
- struct impl;
-
- template <std::size_t>
- struct proto_expr { typedef proto::_ type; };
-
- template <std::size_t Index>
- struct nth_assign
- {
- typedef
- assign type(
- proto::_child_c<Index>
- , proto::call<proto::_child_c<Index>(proto::_state)>
- )
- ;
- };
-
- template <typename Expr, typename State, typename Data>
- struct impl<Expr, State, Data, detail::index_sequence<> >
- : proto::when<
- proto::terminal<proto::_>
- , do_assign(proto::_, proto::_state)
- >::template impl<Expr, State, Data>
- {
- };
-
- template <typename Expr, typename State, typename Data
- , std::size_t... Indices>
- struct impl<Expr, State, Data, detail::index_sequence<Indices...> >
- : proto::when<
- proto::nary_expr<typename proto_expr<Indices>::type...>
- , proto::and_<typename nth_assign<Indices>::type...>
- >::template impl<Expr, State, Data>
- {
- };
- };
-#endif
}
namespace result_of
@@ -202,67 +143,9 @@ namespace boost { namespace phoenix
>::type
expr_type;
- BOOST_PROTO_BASIC_EXTENDS(expr_type, actor<expr_type>, phoenix_domain)
-
- // providing operator= to be assignable
- actor& operator=(actor const& other)
- {
- detail::assign()(*this, other);
- return *this;
- }
- actor& operator=(actor & other)
- {
- detail::assign()(*this, other);
- return *this;
- }
-
- template <typename A0>
- typename proto::result_of::make_expr<
- proto::tag::assign
- , phoenix_domain
- , proto_base_expr
- , A0
- >::type const
- operator=(A0 const & a0) const
- {
- return proto::make_expr<proto::tag::assign, phoenix_domain>(this->proto_expr_, a0);
- }
-
- template <typename A0>
- typename proto::result_of::make_expr<
- proto::tag::assign
- , phoenix_domain
- , proto_base_expr
- , A0
- >::type const
- operator=(A0 & a0) const
- {
- return proto::make_expr<proto::tag::assign, phoenix_domain>(this->proto_expr_, a0);
- }
-
- template <typename A0>
- typename proto::result_of::make_expr<
- proto::tag::subscript
- , phoenix_domain
- , proto_base_expr
- , A0
- >::type const
- operator[](A0 const & a0) const
- {
- return proto::make_expr<proto::tag::subscript, phoenix_domain>(this->proto_expr_, a0);
- }
-
- template <typename A0>
- typename proto::result_of::make_expr<
- proto::tag::subscript
- , phoenix_domain
- , proto_base_expr
- , A0
- >::type const
- operator[](A0 & a0) const
- {
- return proto::make_expr<proto::tag::subscript, phoenix_domain>(this->proto_expr_, a0);
- }
+ BOOST_PROTO_BASIC_EXTENDS(expr_type, actor<Expr>, phoenix_domain)
+ BOOST_PROTO_EXTENDS_SUBSCRIPT()
+ BOOST_PROTO_EXTENDS_ASSIGN()
template <typename Sig>
struct result;