Update of /cvsroot/boost/boost/boost/xpressive/proto
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28127/proto
Modified Files:
matches.hpp proto_fwd.hpp
Log Message:
conditional transform is BS. remove it. proto::if_ does it all.
Index: matches.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/matches.hpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- matches.hpp 16 Jun 2007 09:21:17 -0000 1.48
+++ matches.hpp 19 Jun 2007 06:03:26 -0000 1.49
@@ -331,9 +331,9 @@
#undef BOOST_PROTO_DEFINE_LAMBDA_MATCHES
// handle proto::if_
- template<typename Expr, typename Pred>
- struct matches_impl<Expr, if_<Pred> >
- : mpl::apply1<Pred, Expr>::type
+ template<typename Expr, typename Condition>
+ struct matches_impl<Expr, if_<Condition> >
+ : mpl::apply1<Condition, Expr>::type
{};
// handle proto::not_
@@ -428,12 +428,6 @@
}
template<typename Pred>
- struct if_ : has_identity_transform
- {
- typedef if_ proto_base_expr;
- };
-
- template<typename Pred>
struct not_ : has_identity_transform
{
typedef not_ proto_base_expr;
@@ -459,6 +453,27 @@
template<typename T>
struct exact
{};
+
+ template<typename Condition, typename Then, typename Else>
+ struct if_
+ : or_<
+ and_<if_<Condition>, Then>
+ , and_<not_<if_<Condition> >, Else>
+ >
+ {};
+
+ template<typename Condition, typename Then>
+ struct if_<Condition, Then, void>
+ : and_<if_<Condition>, Then>
+ {};
+
+ template<typename Condition>
+ struct if_<Condition, void, void>
+ : has_identity_transform
+ {
+ typedef if_ proto_base_expr;
+ };
+
}}
#endif
Index: proto_fwd.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/proto/proto_fwd.hpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -d -r1.73 -r1.74
--- proto_fwd.hpp 16 Jun 2007 09:21:17 -0000 1.73
+++ proto_fwd.hpp 19 Jun 2007 06:03:26 -0000 1.74
@@ -146,7 +146,7 @@
>
struct and_;
- template<typename Pred>
+ template<typename Condition, typename Then = void, typename Else = void>
struct if_;
template<typename Cases>
-------------------------------------------------------------------------
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