|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80273 - in trunk: boost/proto boost/proto/detail boost/proto/detail/preprocessed libs/proto/test
From: eric_at_[hidden]
Date: 2012-08-27 21:39:03
Author: eric_niebler
Date: 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
New Revision: 80273
URL: http://svn.boost.org/trac/boost/changeset/80273
Log:
hook undocumented convert Fusion customization point so that mpl algorithms work with proto expression types
Added:
trunk/libs/proto/test/mpl.cpp (contents, props changed)
Text files modified:
trunk/boost/proto/detail/basic_expr.hpp | 2
trunk/boost/proto/detail/expr.hpp | 2
trunk/boost/proto/detail/preprocessed/basic_expr.hpp | 22 +++---
trunk/boost/proto/detail/preprocessed/expr.hpp | 22 +++---
trunk/boost/proto/detail/preprocessed/expr_variadic.hpp | 22 +++---
trunk/boost/proto/extends.hpp | 4
trunk/boost/proto/fusion.hpp | 141 +++++++++++++++++++++++++++------------
trunk/boost/proto/proto_fwd.hpp | 6
trunk/libs/proto/test/Jamfile.v2 | 1
trunk/libs/proto/test/cpp-next_bug.cpp | 2
10 files changed, 140 insertions(+), 84 deletions(-)
Modified: trunk/boost/proto/detail/basic_expr.hpp
==============================================================================
--- trunk/boost/proto/detail/basic_expr.hpp (original)
+++ trunk/boost/proto/detail/basic_expr.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -100,7 +100,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_; /**< INTERNAL ONLY */
Modified: trunk/boost/proto/detail/expr.hpp
==============================================================================
--- trunk/boost/proto/detail/expr.hpp (original)
+++ trunk/boost/proto/detail/expr.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -131,7 +131,7 @@
typedef basic_expr<Tag, proto_args, BOOST_PP_ITERATION() > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_; /**< INTERNAL ONLY */
Modified: trunk/boost/proto/detail/preprocessed/basic_expr.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/basic_expr.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/basic_expr.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -44,7 +44,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -122,7 +122,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -206,7 +206,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
@@ -277,7 +277,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
@@ -348,7 +348,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
@@ -419,7 +419,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
@@ -490,7 +490,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
@@ -561,7 +561,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
@@ -632,7 +632,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
@@ -703,7 +703,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
@@ -774,7 +774,7 @@
typedef basic_expr proto_grammar;
typedef basic_default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef basic_expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
Modified: trunk/boost/proto/detail/preprocessed/expr.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/expr.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/expr.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -44,7 +44,7 @@
typedef basic_expr<Tag, proto_args, 0 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -585,7 +585,7 @@
typedef basic_expr<Tag, proto_args, 1 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -916,7 +916,7 @@
typedef basic_expr<Tag, proto_args, 2 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
@@ -1234,7 +1234,7 @@
typedef basic_expr<Tag, proto_args, 3 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
@@ -1552,7 +1552,7 @@
typedef basic_expr<Tag, proto_args, 4 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
@@ -1870,7 +1870,7 @@
typedef basic_expr<Tag, proto_args, 5 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
@@ -2188,7 +2188,7 @@
typedef basic_expr<Tag, proto_args, 6 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
@@ -2506,7 +2506,7 @@
typedef basic_expr<Tag, proto_args, 7 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
@@ -2824,7 +2824,7 @@
typedef basic_expr<Tag, proto_args, 8 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
@@ -3142,7 +3142,7 @@
typedef basic_expr<Tag, proto_args, 9 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
@@ -3460,7 +3460,7 @@
typedef basic_expr<Tag, proto_args, 10 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
Modified: trunk/boost/proto/detail/preprocessed/expr_variadic.hpp
==============================================================================
--- trunk/boost/proto/detail/preprocessed/expr_variadic.hpp (original)
+++ trunk/boost/proto/detail/preprocessed/expr_variadic.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -44,7 +44,7 @@
typedef basic_expr<Tag, proto_args, 0 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -330,7 +330,7 @@
typedef basic_expr<Tag, proto_args, 1 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0;
@@ -533,7 +533,7 @@
typedef basic_expr<Tag, proto_args, 2 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
@@ -723,7 +723,7 @@
typedef basic_expr<Tag, proto_args, 3 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
@@ -913,7 +913,7 @@
typedef basic_expr<Tag, proto_args, 4 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
@@ -1103,7 +1103,7 @@
typedef basic_expr<Tag, proto_args, 5 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
@@ -1293,7 +1293,7 @@
typedef basic_expr<Tag, proto_args, 6 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
@@ -1483,7 +1483,7 @@
typedef basic_expr<Tag, proto_args, 7 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
@@ -1673,7 +1673,7 @@
typedef basic_expr<Tag, proto_args, 8 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
@@ -1863,7 +1863,7 @@
typedef basic_expr<Tag, proto_args, 9 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
@@ -2053,7 +2053,7 @@
typedef basic_expr<Tag, proto_args, 10 > proto_grammar;
typedef default_domain proto_domain;
typedef default_generator proto_generator;
- typedef proto::tag::proto_expr fusion_tag;
+ typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
typedef expr proto_derived_expr;
typedef void proto_is_expr_;
typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
Modified: trunk/boost/proto/extends.hpp
==============================================================================
--- trunk/boost/proto/extends.hpp (original)
+++ trunk/boost/proto/extends.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -172,7 +172,7 @@
typedef typename proto_base_expr::address_of_hack_type_ proto_address_of_hack_type_; \
typedef void proto_is_expr_; /**< INTERNAL ONLY */ \
static const long proto_arity_c = proto_base_expr::proto_arity_c; \
- typedef boost::proto::tag::proto_expr fusion_tag; \
+ typedef boost::proto::tag::proto_expr<proto_tag, proto_domain> fusion_tag; \
BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, BOOST_PROTO_EXTENDS_CHILD, ~) \
\
BOOST_PROTO_DISABLE_MSVC_C4714 BOOST_FORCEINLINE \
@@ -571,7 +571,7 @@
typedef detail::not_a_valid_type proto_address_of_hack_type_;
typedef void proto_is_expr_; /**< INTERNAL ONLY */
static const long proto_arity_c = 2;
- typedef boost::proto::tag::proto_expr fusion_tag;
+ typedef boost::proto::tag::proto_expr<proto_tag, Domain> fusion_tag;
typedef This &proto_child0;
typedef expr<tag::terminal, term<Fun> > const &proto_child1;
typedef expr<proto_tag, proto_args, proto_arity_c> proto_base_expr;
Modified: trunk/boost/proto/fusion.hpp
==============================================================================
--- trunk/boost/proto/fusion.hpp (original)
+++ trunk/boost/proto/fusion.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -27,6 +27,7 @@
#include <boost/proto/proto_fwd.hpp>
#include <boost/proto/traits.hpp>
#include <boost/proto/eval.hpp>
+#include <boost/proto/make_expr.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
@@ -46,7 +47,12 @@
typedef Expr expr_type;
static const long index = Pos;
typedef fusion::random_access_traversal_tag category;
- typedef tag::proto_expr_iterator fusion_tag;
+ typedef
+ tag::proto_expr_iterator<
+ typename Expr::proto_tag
+ , typename Expr::proto_domain
+ >
+ fusion_tag;
explicit expr_iterator(Expr &e)
: expr(e)
@@ -60,7 +66,12 @@
{
typedef Expr expr_type;
typedef fusion::forward_traversal_tag category;
- typedef tag::proto_flat_view fusion_tag;
+ typedef
+ tag::proto_flat_view<
+ typename Expr::proto_tag
+ , typename Expr::proto_domain
+ >
+ fusion_tag;
explicit flat_view(Expr &e)
: expr_(e)
@@ -250,8 +261,8 @@
template<typename Tag>
struct is_sequence_impl;
- template<>
- struct is_sequence_impl<proto::tag::proto_flat_view>
+ template<typename Tag, typename Domain>
+ struct is_sequence_impl<proto::tag::proto_flat_view<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -259,8 +270,8 @@
{};
};
- template<>
- struct is_sequence_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct is_sequence_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -271,8 +282,8 @@
template<typename Tag>
struct is_view_impl;
- template<>
- struct is_view_impl<proto::tag::proto_flat_view>
+ template<typename Tag, typename Domain>
+ struct is_view_impl<proto::tag::proto_flat_view<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -280,8 +291,8 @@
{};
};
- template<>
- struct is_view_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct is_view_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -292,8 +303,8 @@
template<typename Tag>
struct value_of_impl;
- template<>
- struct value_of_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct value_of_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<
typename Iterator
@@ -323,8 +334,8 @@
template<typename Tag>
struct deref_impl;
- template<>
- struct deref_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct deref_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<
typename Iterator
@@ -364,8 +375,8 @@
template<typename Tag>
struct advance_impl;
- template<>
- struct advance_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<typename Iterator, typename N>
struct apply
@@ -387,8 +398,8 @@
template<typename Tag>
struct distance_impl;
- template<>
- struct distance_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct distance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<typename IteratorFrom, typename IteratorTo>
struct apply
@@ -399,32 +410,32 @@
template<typename Tag>
struct next_impl;
- template<>
- struct next_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct next_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<typename Iterator>
struct apply
- : advance_impl<proto::tag::proto_expr_iterator>::template apply<Iterator, mpl::long_<1> >
+ : advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >::template apply<Iterator, mpl::long_<1> >
{};
};
template<typename Tag>
struct prior_impl;
- template<>
- struct prior_impl<proto::tag::proto_expr_iterator>
+ template<typename Tag, typename Domain>
+ struct prior_impl<proto::tag::proto_expr_iterator<Tag, Domain> >
{
template<typename Iterator>
struct apply
- : advance_impl<proto::tag::proto_expr_iterator>::template apply<Iterator, mpl::long_<-1> >
+ : advance_impl<proto::tag::proto_expr_iterator<Tag, Domain> >::template apply<Iterator, mpl::long_<-1> >
{};
};
template<typename Tag>
struct category_of_impl;
- template<>
- struct category_of_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct category_of_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -436,8 +447,8 @@
template<typename Tag>
struct size_impl;
- template<>
- struct size_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct size_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -448,8 +459,8 @@
template<typename Tag>
struct begin_impl;
- template<>
- struct begin_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct begin_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -466,8 +477,8 @@
template<typename Tag>
struct end_impl;
- template<>
- struct end_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct end_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -489,8 +500,8 @@
template<typename Tag>
struct value_at_impl;
- template<>
- struct value_at_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct value_at_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<
typename Sequence
@@ -521,8 +532,8 @@
template<typename Tag>
struct at_impl;
- template<>
- struct at_impl<proto::tag::proto_expr>
+ template<typename Tag, typename Domain>
+ struct at_impl<proto::tag::proto_expr<Tag, Domain> >
{
template<
typename Sequence
@@ -561,10 +572,55 @@
};
template<typename Tag>
+ struct convert_impl;
+
+ template<typename Tag, typename Domain>
+ struct convert_impl<proto::tag::proto_expr<Tag, Domain> >
+ {
+ template<typename Sequence>
+ struct apply
+ {
+ typedef
+ typename proto::result_of::unpack_expr<
+ Tag
+ , Domain
+ , Sequence
+ >::type
+ type;
+
+ static type call(Sequence& seq)
+ {
+ return proto::unpack_expr<Tag, Domain>(seq);
+ }
+ };
+ };
+
+ template<typename Tag, typename Domain>
+ struct convert_impl<proto::tag::proto_flat_view<Tag, Domain> >
+ {
+ template<typename Sequence>
+ struct apply
+ {
+ typedef
+ typename proto::result_of::unpack_expr<
+ Tag
+ , Domain
+ , Sequence
+ >::type
+ type;
+
+ static type call(Sequence& seq)
+ {
+ return proto::unpack_expr<Tag, Domain>(seq);
+ }
+ };
+ };
+
+ template<typename Tag>
struct is_segmented_impl;
- template<>
- struct is_segmented_impl<proto::tag::proto_flat_view>
+ template<typename Tag, typename Domain>
+ struct is_segmented_impl<proto::tag::proto_flat_view<Tag, Domain> >
{
template<typename Iterator>
struct apply
@@ -575,8 +631,8 @@
template<typename Tag>
struct segments_impl;
- template<>
- struct segments_impl<proto::tag::proto_flat_view>
+ template<typename Tag, typename Domain>
+ struct segments_impl<proto::tag::proto_flat_view<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -597,8 +653,8 @@
};
};
- template<>
- struct category_of_impl<proto::tag::proto_flat_view>
+ template<typename Tag, typename Domain>
+ struct category_of_impl<proto::tag::proto_flat_view<Tag, Domain> >
{
template<typename Sequence>
struct apply
@@ -606,7 +662,6 @@
typedef forward_traversal_tag type;
};
};
-
}
namespace traits
Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -291,9 +291,9 @@
struct function;
// Fusion tags
- struct proto_expr;
- struct proto_expr_iterator;
- struct proto_flat_view;
+ template<typename Tag, typename Domain> struct proto_expr;
+ template<typename Tag, typename Domain> struct proto_expr_iterator;
+ template<typename Tag, typename Domain> struct proto_flat_view;
}
}
Modified: trunk/libs/proto/test/Jamfile.v2
==============================================================================
--- trunk/libs/proto/test/Jamfile.v2 (original)
+++ trunk/libs/proto/test/Jamfile.v2 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -39,6 +39,7 @@
[ run toy_spirit2.cpp ]
[ run make.cpp ]
[ run mem_ptr.cpp : : : <toolset>msvc:<cxxflags>/wd4355 ]
+ [ run mpl.cpp ]
[ run noinvoke.cpp ]
[ run pack_expansion.cpp ]
[ run protect.cpp ]
Modified: trunk/libs/proto/test/cpp-next_bug.cpp
==============================================================================
--- trunk/libs/proto/test/cpp-next_bug.cpp (original)
+++ trunk/libs/proto/test/cpp-next_bug.cpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -72,7 +72,7 @@
//
test_suite* init_unit_test_suite( int argc, char* argv[] )
{
- test_suite *test = BOOST_TEST_SUITE("test deducing domains from sub-domains");
+ test_suite *test = BOOST_TEST_SUITE("test for a problem reported on the cpp-next.com blog");
test->add(BOOST_TEST_CASE(&test1));
Added: trunk/libs/proto/test/mpl.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/proto/test/mpl.cpp 2012-08-27 21:38:59 EDT (Mon, 27 Aug 2012)
@@ -0,0 +1,67 @@
+///////////////////////////////////////////////////////////////////////////////
+// mpl.hpp
+//
+// Copyright 2012 Eric Niebler. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#include <boost/proto/proto.hpp>
+#include <boost/fusion/mpl.hpp>
+#include <boost/mpl/pop_back.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/test/unit_test.hpp>
+namespace mpl = boost::mpl;
+namespace proto = boost::proto;
+namespace fusion = boost::fusion;
+using proto::_;
+
+template<class E>
+struct my_expr;
+
+struct my_domain
+ : proto::domain<proto::generator<my_expr> >
+{};
+
+template<class E>
+struct my_expr
+ : proto::extends<E, my_expr<E>, my_domain>
+{
+ my_expr(E const &e = E())
+ : proto::extends<E, my_expr<E>, my_domain>(e)
+ {}
+
+ typedef fusion::fusion_sequence_tag tag;
+};
+
+template<typename T>
+void test_impl(T const &)
+{
+ typedef typename mpl::pop_back<T>::type result_type;
+ BOOST_STATIC_ASSERT(
+ (boost::is_same<
+ result_type
+ , my_expr<proto::basic_expr<proto::tag::plus, proto::list1<my_expr<proto::terminal<int>::type>&> > >
+ >::value)
+ );
+}
+
+// Test that we can call mpl algorithms on proto expression types, and get proto expression types back
+void test_mpl()
+{
+ my_expr<proto::terminal<int>::type> i;
+ test_impl(i + i);
+}
+
+using namespace boost::unit_test;
+///////////////////////////////////////////////////////////////////////////////
+// init_unit_test_suite
+//
+test_suite* init_unit_test_suite( int argc, char* argv[] )
+{
+ test_suite *test = BOOST_TEST_SUITE("test proto mpl integration via fusion");
+
+ test->add(BOOST_TEST_CASE(&test_mpl));
+
+ return test;
+}
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