Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9563/boost/xpressive/proto
Modified Files:
deep_copy.hpp domain.hpp extends.hpp generate.hpp
make_expr.hpp operators.hpp proto_fwd.hpp traits.hpp
Log Message:
kill proto::generate<>
Index: deep_copy.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/deep_copy.hpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- deep_copy.hpp 24 May 2007 23:25:40 -0000 1.13
+++ deep_copy.hpp 26 May 2007 00:53:57 -0000 1.14
@@ -31,13 +31,13 @@
struct deep_copy_impl<Expr, tag::terminal, 1>
{
typedef typename terminal<typename
result_of::arg<Expr>::type>::type expr_type;
- typedef typename generate<typename Expr::domain,
expr_type>::type type;
+ typedef typename Expr::domain::template apply<expr_type>::type
type;
template<typename Expr2>
static type call(Expr2 const &expr)
{
expr_type that = {proto::arg(expr)};
- return generate<typename Expr::domain,
expr_type>::make(that);
+ return Expr::domain::make(that);
}
};
}
@@ -104,7 +104,7 @@
typedef expr<Tag, BOOST_PP_CAT(args, N)<
BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_TYPE, ~)
> > expr_type;
- typedef typename generate<typename Expr::domain,
expr_type>::type type;
+ typedef typename Expr::domain::template apply<expr_type>::type
type;
template<typename Expr2>
static type call(Expr2 const &expr)
@@ -112,7 +112,7 @@
expr_type that = {
BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
};
- return generate<typename Expr::domain,
expr_type>::make(that);
+ return Expr::domain::make(that);
}
};
Index: domain.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/domain.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- domain.hpp 25 May 2007 00:53:40 -0000 1.2
+++ domain.hpp 26 May 2007 00:53:57 -0000 1.3
@@ -18,8 +18,9 @@
namespace boost { namespace proto
{
- template<typename Grammar>
+ template<typename Generator, typename Grammar>
struct domain
+ : Generator
{
typedef Grammar grammar;
Index: extends.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/extends.hpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- extends.hpp 21 May 2007 03:32:00 -0000 1.33
+++ extends.hpp 26 May 2007 00:53:57 -0000 1.34
@@ -19,6 +19,7 @@
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/mpl/apply_wrap.hpp>
#include <boost/xpressive/proto/proto_fwd.hpp>
#include <boost/xpressive/proto/traits.hpp>
#include <boost/xpressive/proto/expr.hpp>
@@ -49,7 +50,7 @@
///
#define BOOST_PROTO_DEFINE_FUN_OP_IMPL_(Z, N, Data, Const)\
BOOST_PP_IF(N, BOOST_PROTO_TEMPLATE_YES_, BOOST_PROTO_TEMPLATE_NO_)(Z,
N)\
- typename boost::proto::generate<\
+ typename boost::mpl::apply_wrap1<\
BOOST_PP_TUPLE_ELEM(3, 2, Data)\
, typename boost::proto::result_of::BOOST_PP_CAT(funop, N)<\
BOOST_PP_TUPLE_ELEM(3, 1, Data) BOOST_PROTO_CONST ## Const\
@@ -62,7 +63,7 @@
BOOST_PP_TUPLE_ELEM(3, 1, Data) BOOST_PROTO_CONST ## Const\
BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, const A)\
> funop;\
- return boost::proto::generate<BOOST_PP_TUPLE_ELEM(3, 2, Data),
typename funop::type>::make(\
+ return BOOST_PP_TUPLE_ELEM(3, 2, Data)::make(\
funop::call(*static_cast<BOOST_PP_TUPLE_ELEM(3, 1, Data)
BOOST_PROTO_CONST ## Const *>(this) BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, a))\
);\
}\
@@ -129,21 +130,21 @@
///
#define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(Expr, Derived, Domain, Const)\
template<typename A>\
- typename boost::proto::generate<Domain,
boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > >::type const\
+ typename boost::mpl::apply_wrap1<Domain,
boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > >::type const\
operator =(A &a) BOOST_PROTO_CONST ## Const\
{\
typedef boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > that_type;\
that_type that = {{*static_cast<Derived BOOST_PROTO_CONST ## Const
*>(this)}, boost::proto::as_arg(a)};\
- return boost::proto::generate<Domain, that_type>::make(that);\
+ return Domain::make(that);\
}\
\
template<typename A>\
- typename boost::proto::generate<Domain,
boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > >::type const\
+ typename boost::mpl::apply_wrap1<Domain,
boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > >::type const\
operator =(A const &a) BOOST_PROTO_CONST ## Const\
{\
typedef boost::proto::expr<boost::proto::tag::assign,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > that_type;\
that_type that = {{*static_cast<Derived BOOST_PROTO_CONST ## Const
*>(this)}, boost::proto::as_arg(a)};\
- return boost::proto::generate<Domain, that_type>::make(that);\
+ return Domain::make(that);\
}\
/**/
@@ -162,21 +163,21 @@
///
#define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(Expr, Derived, Domain, Const)\
template<typename A>\
- typename boost::proto::generate<Domain,
boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > >::type const\
+ typename boost::mpl::apply_wrap1<Domain,
boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > >::type const\
operator [](A &a) BOOST_PROTO_CONST ## Const\
{\
typedef boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A>::type> > that_type;\
that_type that = {{*static_cast<Derived BOOST_PROTO_CONST ## Const
*>(this)}, boost::proto::as_arg(a)};\
- return boost::proto::generate<Domain, that_type>::make(that);\
+ return Domain::make(that);\
}\
\
template<typename A>\
- typename boost::proto::generate<Domain,
boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > >::type const\
+ typename boost::mpl::apply_wrap1<Domain,
boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > >::type const\
operator [](A const &a) BOOST_PROTO_CONST ## Const\
{\
typedef boost::proto::expr<boost::proto::tag::subscript,
boost::proto::args2<boost::proto::ref_<Derived BOOST_PROTO_CONST ## Const>,
typename boost::proto::result_of::as_arg<A const>::type> > that_type;\
that_type that = {{*static_cast<Derived BOOST_PROTO_CONST ## Const
*>(this)}, boost::proto::as_arg(a)};\
- return boost::proto::generate<Domain, that_type>::make(that);\
+ return Domain::make(that);\
}\
/**/
@@ -198,7 +199,7 @@
struct result\
{\
typedef\
- typename boost::proto::generate<Domain, typename
boost::proto::result_of::funop<Sig, Derived >::type>::type\
+ typename boost::mpl::apply_wrap1<Domain, typename
boost::proto::result_of::funop<Sig, Derived >::type>::type\
type;\
};\
/**/
Index: generate.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/generate.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- generate.hpp 19 Apr 2007 03:16:25 -0000 1.3
+++ generate.hpp 26 May 2007 00:53:57 -0000 1.4
@@ -20,14 +20,51 @@
namespace boost { namespace proto
{
- template<typename Domain, typename Expr>
- struct generate
+ struct default_generator
{
- typedef Expr type;
+ template<typename Expr>
+ struct apply
+ {
+ typedef Expr type;
+ };
+ template<typename Expr>
static Expr const &make(Expr const &expr)
{
return expr;
+ };
+ };
+
+ template<template<typename> class Extends>
+ struct generator
+ {
+ template<typename Expr>
+ struct apply
+ {
+ typedef Extends<Expr> type;
+ };
+
+ template<typename Expr>
+ static Extends<Expr> make(Expr const &expr)
+ {
+ return Extends<Expr>(expr);
+ }
+ };
+
+ template<template<typename> class Extends>
+ struct pod_generator
+ {
+ template<typename Expr>
+ struct apply
+ {
+ typedef Extends<Expr> type;
+ };
+
+ template<typename Expr>
+ static Extends<Expr> make(Expr const &expr)
+ {
+ Extends<Expr> that = {expr};
+ return that;
}
};
@@ -40,7 +77,7 @@
struct generate_if
: mpl::if_<
matches<Expr, typename Domain::grammar>
- , generate<Domain, Expr>
+ , typename Domain::template apply<Expr>
, detail::empty
>::type
{};
@@ -48,8 +85,14 @@
// Optimization, generate fewer templates...
template<typename Expr>
struct generate_if<proto::default_domain, Expr>
- : generate<proto::default_domain, Expr>
- {};
+ {
+ typedef Expr type;
+
+ static Expr const &make(Expr const &expr)
+ {
+ return expr;
+ }
+ };
}
}}
Index: make_expr.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/make_expr.hpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- make_expr.hpp 25 May 2007 22:23:54 -0000 1.15
+++ make_expr.hpp 26 May 2007 00:53:57 -0000 1.16
@@ -85,12 +85,12 @@
, args1<typename fusion::result_of::value_at_c<Sequence,
0>::type>
> expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
static type const call(Sequence const &sequence)
{
expr_type that = {fusion::at_c<0>(sequence)};
- return generate<Domain, expr_type>::make(that);
+ return Domain::make(that);
}
};
@@ -108,12 +108,12 @@
{
typedef typename add_reference<A>::type reference;
typedef expr<tag::terminal, args1<reference> > expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
static type const call(reference a)
{
expr_type that = {a};
- return generate<Domain, expr_type>::make(that);
+ return Domain::make(that);
}
};
@@ -290,14 +290,14 @@
, BOOST_PP_CAT(args, N)<BOOST_PP_ENUM(N,
BOOST_PROTO_AS_ARG_TYPE, (A, Domain)) >
> expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
static type const call(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))
{
expr_type that = {
BOOST_PP_ENUM(N, BOOST_PROTO_AS_ARG, (a, Domain))
};
- return generate<Domain, expr_type>::make(that);
+ return Domain::make(that);
}
};
@@ -309,14 +309,14 @@
, BOOST_PP_CAT(args, N)<BOOST_PP_ENUM(N, BOOST_PROTO_AT_TYPE,
(Sequence const, Domain)) >
> expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
static type const call(Sequence const &sequence)
{
expr_type that = {
BOOST_PP_ENUM(N, BOOST_PROTO_AT, (sequence, Domain))
};
- return generate<Domain, expr_type>::make(that);
+ return Domain::make(that);
}
};
Index: operators.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/operators.hpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- operators.hpp 21 May 2007 03:21:33 -0000 1.29
+++ operators.hpp 26 May 2007 00:53:57 -0000 1.30
@@ -37,20 +37,20 @@
Tag
, args2<
ref_<Left>
- , typename generate<typename Left::domain,
expr<tag::terminal, args1<Right &> > >::type
+ , typename Left::domain::template
apply<expr<tag::terminal, args1<Right &> > >::type
>
>
>
{
typedef expr<tag::terminal, args1<Right &> > term_type;
- typedef expr<Tag, args2<ref_<Left>, typename generate<typename
Left::domain, term_type>::type> > expr_type;
+ typedef expr<Tag, args2<ref_<Left>, typename
Left::domain::template apply<term_type>::type> > expr_type;
- static typename generate<typename Left::domain, expr_type>::type
+ static typename Left::domain::template apply<expr_type>::type
make(Left &left, Right &right)
{
term_type term = {right};
- expr_type that = {{left}, generate<typename Left::domain,
term_type>::make(term)};
- return generate<typename Left::domain, expr_type>::make(that);
+ expr_type that = {{left}, Left::domain::make(term)};
+ return Left::domain::make(that);
}
};
@@ -61,21 +61,21 @@
, expr<
Tag
, args2<
- typename generate<typename Right::domain,
expr<tag::terminal, args1<Left &> > >::type
+ typename Right::domain::template
apply<expr<tag::terminal, args1<Left &> > >::type
, ref_<Right>
>
>
>
{
typedef expr<tag::terminal, args1<Left &> > term_type;
- typedef expr<Tag, args2<typename generate<typename Right::domain,
term_type>::type, ref_<Right> > > expr_type;
+ typedef expr<Tag, args2<typename Right::domain::template
apply<term_type>::type, ref_<Right> > > expr_type;
- static typename generate<typename Right::domain, expr_type>::type
+ static typename Right::domain::template apply<expr_type>::type
make(Left &left, Right &right)
{
term_type term = {left};
- expr_type that = {generate<typename Right::domain,
term_type>::make(term), {right}};
- return generate<typename Right::domain, expr_type>::make(that);
+ expr_type that = {Right::domain::make(term), {right}};
+ return Right::domain::make(that);
}
};
@@ -94,11 +94,11 @@
typedef expr<Tag, args2<ref_<Left>, ref_<Right> > > expr_type;
BOOST_MPL_ASSERT((is_same<typename Left::domain, typename
Right::domain>));
- static typename generate<typename Left::domain, expr_type>::type
+ static typename Left::domain::template apply<expr_type>::type
make(Left &left, Right &right)
{
expr_type that = {{left}, {right}};
- return generate<typename Left::domain, expr_type>::make(that);
+ return Left::domain::make(that);
}
};
} // detail
@@ -110,7 +110,7 @@
{\
typedef expr<tag, args1<ref_<typename Arg::boost_proto_expr_type_> > >
that_type;\
that_type that = {{arg}};\
- return generate<typename Arg::domain, that_type>::make(that);\
+ return Arg::domain::make(that);\
}\
template<typename Arg>\
inline typename detail::generate_if<typename Arg::domain, expr<tag,
args1<ref_<typename Arg::boost_proto_expr_type_ const> > > >::type const\
@@ -118,7 +118,7 @@
{\
typedef expr<tag, args1<ref_<typename Arg::boost_proto_expr_type_
const> > > that_type;\
that_type that = {{arg}};\
- return generate<typename Arg::domain, that_type>::make(that);\
+ return Arg::domain::make(that);\
}\
/**/
@@ -199,7 +199,7 @@
{
typedef expr<tag::post_inc, args1<ref_<typename
Arg::boost_proto_expr_type_> > > that_type;
that_type that = {{arg}};
- return generate<typename Arg::domain, that_type>::make(that);
+ return Arg::domain::make(that);
}
template<typename Arg>
@@ -208,7 +208,7 @@
{
typedef expr<tag::post_inc, args1<ref_<typename
Arg::boost_proto_expr_type_ const> > > that_type;
that_type that = {{arg}};
- return generate<typename Arg::domain, that_type>::make(that);
+ return Arg::domain::make(that);
}
template<typename Arg>
@@ -217,7 +217,7 @@
{
typedef expr<tag::post_dec, args1<ref_<typename
Arg::boost_proto_expr_type_> > > that_type;
that_type that = {{arg}};
- return generate<typename Arg::domain, that_type>::make(that);
+ return Arg::domain::make(that);
}
template<typename Arg>
@@ -226,7 +226,7 @@
{
typedef expr<tag::post_dec, args1<ref_<typename
Arg::boost_proto_expr_type_ const> > > that_type;
that_type that = {{arg}};
- return generate<typename Arg::domain, that_type>::make(that);
+ return Arg::domain::make(that);
}
}}
Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_fwd.hpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- proto_fwd.hpp 25 May 2007 22:23:54 -0000 1.66
+++ proto_fwd.hpp 26 May 2007 00:53:57 -0000 1.67
@@ -193,7 +193,15 @@
struct _;
- template<typename Grammar = proto::_>
+ struct default_generator;
+
+ template<template<typename> class Extends>
+ struct generator;
+
+ template<template<typename> class Extends>
+ struct pod_generator;
+
+ template<typename Generator = default_generator, typename Grammar =
proto::_>
struct domain;
typedef domain<> default_domain;
@@ -337,12 +345,6 @@
template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY,
typename A, void), typename Dummy = void>
struct function;
- template<typename Domain, typename Expr>
- struct generate;
-
- template<typename Domain, typename Expr, typename EnableIf = void>
- struct is_allowed;
-
namespace functional
{
struct compile;
Index: traits.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/traits.hpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- traits.hpp 25 May 2007 22:23:54 -0000 1.53
+++ traits.hpp 26 May 2007 00:53:57 -0000 1.54
@@ -91,13 +91,13 @@
>::type arg0_type;
typedef expr<proto::tag::terminal, args1<arg0_type> >
expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
typedef type result_type;
BOOST_PROTO_WITH_ALIAS_(T, T2)
static result_type call(T2 &t)
{
- return generate<Domain,
expr_type>::make(expr_type::make(t));
+ return Domain::make(expr_type::make(t));
}
};
@@ -119,12 +119,12 @@
struct as_arg
{
typedef expr<proto::tag::terminal, args1<T &> > expr_type;
- typedef typename generate<Domain, expr_type>::type type;
+ typedef typename Domain::template apply<expr_type>::type type;
BOOST_PROTO_WITH_ALIAS_(T, T2)
static type call(T2 &t)
{
- return generate<Domain,
expr_type>::make(expr_type::make(t));
+ return Domain::make(expr_type::make(t));
}
};
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs