Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62510 - in branches/release: . boost boost/algorithm/string boost/archive boost/bimap boost/config boost/detail boost/filesystem boost/functional/hash boost/fusion boost/gil boost/graph boost/integer boost/interprocess boost/intrusive boost/iostreams boost/math boost/numeric/ublas boost/program_options boost/property_tree boost/proto boost/proto/context boost/proto/detail boost/proto/transform boost/python boost/range boost/regex boost/serialization boost/signals boost/signals2 boost/spirit boost/spirit/home boost/spirit/home/karma boost/spirit/home/support boost/statechart boost/system boost/thread boost/tr1 boost/type_traits boost/unordered boost/utility boost/uuid boost/variant boost/wave doc libs libs/array/doc libs/array/test libs/bimap libs/config libs/filesystem libs/functional/hash libs/fusion libs/graph_parallel libs/integer libs/interprocess libs/intrusive libs/iostreams libs/math libs/mpl/doc/refmanual libs/mpl/doc/src/refmanual libs/numeric/ublas libs/numeric/ublas/doc libs/program_options libs/property_tree libs/python libs/range libs/range/doc libs/regex libs/regex/doc libs/serialization libs/signals libs/signals2 libs/spirit libs/spirit/classic/example libs/spirit/doc libs/spirit/example libs/spirit/phoenix libs/spirit/test libs/spirit/test/qi libs/statechart libs/static_assert libs/system libs/thread libs/timer libs/tr1 libs/type_traits libs/unordered libs/utility libs/utility/swap/test libs/uuid libs/wave more more/getting_started people status tools tools/bcp tools/boostbook tools/build/v2 tools/build/v2/tools tools/inspect tools/jam tools/quickbook tools/regression tools/release tools/wave wiki
From: eric_at_[hidden]
Date: 2010-06-07 12:57:10


Author: eric_niebler
Date: 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
New Revision: 62510
URL: http://svn.boost.org/trac/boost/changeset/62510

Log:
Merged revisions 62368,62371-62372,62479 via svnmerge from
https://svn.boost.org/svn/boost/trunk

........
  r62368 | eric_niebler | 2010-06-01 10:18:42 -0400 (Tue, 01 Jun 2010) | 1 line
  
  use boost::tr1_result_of to avoid problems with boost::result_of and decltype
........
  r62371 | eric_niebler | 2010-06-01 18:10:54 -0400 (Tue, 01 Jun 2010) | 1 line
  
  fix one return type missed by [62368]
........
  r62372 | eric_niebler | 2010-06-01 18:13:33 -0400 (Tue, 01 Jun 2010) | 1 line
  
  use generators directly instead of relying on the domain to inherit from them, which seems a dubious design
........
  r62479 | eric_niebler | 2010-06-06 09:40:44 -0400 (Sun, 06 Jun 2010) | 1 line
  
  major simplification of proto/operators.hpp
........

Properties modified:
   branches/release/ (props changed)
   branches/release/INSTALL (props changed)
   branches/release/Jamroot (props changed)
   branches/release/LICENSE_1_0.txt (props changed)
   branches/release/boost/ (props changed)
   branches/release/boost-build.jam (props changed)
   branches/release/boost.css (props changed)
   branches/release/boost.png (props changed)
   branches/release/boost/algorithm/string/ (props changed)
   branches/release/boost/archive/ (props changed)
   branches/release/boost/array.hpp (props changed)
   branches/release/boost/bimap/ (props changed)
   branches/release/boost/config/ (props changed)
   branches/release/boost/config.hpp (props changed)
   branches/release/boost/detail/ (props changed)
   branches/release/boost/detail/endian.hpp (props changed)
   branches/release/boost/filesystem/ (props changed)
   branches/release/boost/functional/hash/ (props changed)
   branches/release/boost/fusion/ (props changed)
   branches/release/boost/gil/ (props changed)
   branches/release/boost/graph/ (props changed)
   branches/release/boost/integer/ (props changed)
   branches/release/boost/interprocess/ (props changed)
   branches/release/boost/intrusive/ (props changed)
   branches/release/boost/iostreams/ (props changed)
   branches/release/boost/math/ (props changed)
   branches/release/boost/numeric/ublas/ (props changed)
   branches/release/boost/program_options/ (props changed)
   branches/release/boost/property_tree/ (props changed)
   branches/release/boost/python/ (props changed)
   branches/release/boost/range/ (props changed)
   branches/release/boost/regex/ (props changed)
   branches/release/boost/serialization/ (props changed)
   branches/release/boost/serialization/factory.hpp (props changed)
   branches/release/boost/signals/ (props changed)
   branches/release/boost/signals2/ (props changed)
   branches/release/boost/spirit/ (props changed)
   branches/release/boost/spirit/home/ (props changed)
   branches/release/boost/spirit/home/karma/ (props changed)
   branches/release/boost/spirit/home/support/attributes.hpp (props changed)
   branches/release/boost/statechart/ (props changed)
   branches/release/boost/system/ (props changed)
   branches/release/boost/thread/ (props changed)
   branches/release/boost/thread.hpp (props changed)
   branches/release/boost/tr1/ (props changed)
   branches/release/boost/type_traits/ (props changed)
   branches/release/boost/unordered/ (props changed)
   branches/release/boost/utility/ (props changed)
   branches/release/boost/utility/value_init.hpp (props changed)
   branches/release/boost/uuid/ (props changed)
   branches/release/boost/variant/ (props changed)
   branches/release/boost/version.hpp (props changed)
   branches/release/boost/wave/ (props changed)
   branches/release/bootstrap.bat (props changed)
   branches/release/bootstrap.sh (props changed)
   branches/release/doc/ (props changed)
   branches/release/index.htm (props changed)
   branches/release/index.html (props changed)
   branches/release/libs/ (props changed)
   branches/release/libs/array/doc/array.xml (props changed)
   branches/release/libs/array/test/array0.cpp (props changed)
   branches/release/libs/bimap/ (props changed)
   branches/release/libs/config/ (props changed)
   branches/release/libs/filesystem/ (props changed)
   branches/release/libs/functional/hash/ (props changed)
   branches/release/libs/fusion/ (props changed)
   branches/release/libs/graph_parallel/ (props changed)
   branches/release/libs/integer/ (props changed)
   branches/release/libs/interprocess/ (props changed)
   branches/release/libs/intrusive/ (props changed)
   branches/release/libs/iostreams/ (props changed)
   branches/release/libs/libraries.htm (props changed)
   branches/release/libs/maintainers.txt (props changed)
   branches/release/libs/math/ (props changed)
   branches/release/libs/mpl/doc/refmanual/broken-compiler-workarounds.html (props changed)
   branches/release/libs/mpl/doc/refmanual/categorized-index-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/cfg-no-preprocessed-headers.html (props changed)
   branches/release/libs/mpl/doc/refmanual/composition-and-argument-binding.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-concepts.html (props changed)
   branches/release/libs/mpl/doc/refmanual/data-types-miscellaneous.html (props changed)
   branches/release/libs/mpl/doc/refmanual/extensible-associative-sequence.html (props changed)
   branches/release/libs/mpl/doc/refmanual/inserter-class.html (props changed)
   branches/release/libs/mpl/doc/refmanual/tag-dispatched-metafunction.html (props changed)
   branches/release/libs/mpl/doc/refmanual/trivial-metafunctions-summary.html (props changed)
   branches/release/libs/mpl/doc/src/refmanual/Iterators-Iterator.rst (props changed)
   branches/release/libs/numeric/ublas/ (props changed)
   branches/release/libs/numeric/ublas/doc/ (props changed)
   branches/release/libs/program_options/ (props changed)
   branches/release/libs/property_tree/ (props changed)
   branches/release/libs/python/ (props changed)
   branches/release/libs/range/ (props changed)
   branches/release/libs/range/doc/ (props changed)
   branches/release/libs/regex/ (props changed)
   branches/release/libs/regex/doc/ (props changed)
   branches/release/libs/serialization/ (props changed)
   branches/release/libs/signals/ (props changed)
   branches/release/libs/signals2/ (props changed)
   branches/release/libs/spirit/ (props changed)
   branches/release/libs/spirit/classic/example/ (props changed)
   branches/release/libs/spirit/doc/ (props changed)
   branches/release/libs/spirit/example/ (props changed)
   branches/release/libs/spirit/phoenix/ (props changed)
   branches/release/libs/spirit/test/ (props changed)
   branches/release/libs/spirit/test/qi/optional.cpp (props changed)
   branches/release/libs/statechart/ (props changed)
   branches/release/libs/static_assert/ (props changed)
   branches/release/libs/system/ (props changed)
   branches/release/libs/thread/ (props changed)
   branches/release/libs/timer/ (props changed)
   branches/release/libs/tr1/ (props changed)
   branches/release/libs/type_traits/ (props changed)
   branches/release/libs/unordered/ (props changed)
   branches/release/libs/utility/ (props changed)
   branches/release/libs/utility/swap.html (props changed)
   branches/release/libs/utility/swap/test/std_bitset.cpp (props changed)
   branches/release/libs/utility/value_init.htm (props changed)
   branches/release/libs/utility/value_init_test.cpp (props changed)
   branches/release/libs/uuid/ (props changed)
   branches/release/libs/wave/ (props changed)
   branches/release/more/ (props changed)
   branches/release/more/getting_started/ (props changed)
   branches/release/people/ (props changed)
   branches/release/rst.css (props changed)
   branches/release/status/ (props changed)
   branches/release/status/Jamfile.v2 (props changed)
   branches/release/tools/ (props changed)
   branches/release/tools/bcp/ (props changed)
   branches/release/tools/boostbook/ (props changed)
   branches/release/tools/build/v2/ (props changed)
   branches/release/tools/build/v2/tools/ (props changed)
   branches/release/tools/inspect/ (props changed)
   branches/release/tools/jam/ (props changed)
   branches/release/tools/quickbook/ (props changed)
   branches/release/tools/regression/ (props changed)
   branches/release/tools/release/ (props changed)
   branches/release/tools/wave/ (props changed)
   branches/release/wiki/ (props changed)
Text files modified:
   branches/release/boost/proto/context/callable.hpp | 4
   branches/release/boost/proto/context/default.hpp | 16
   branches/release/boost/proto/deep_copy.hpp | 12
   branches/release/boost/proto/detail/decltype.hpp | 11
   branches/release/boost/proto/detail/expr0.hpp | 1
   branches/release/boost/proto/extends.hpp | 38 +-
   branches/release/boost/proto/generate.hpp | 8
   branches/release/boost/proto/make_expr.hpp | 12
   branches/release/boost/proto/matches.hpp | 34 ++
   branches/release/boost/proto/operators.hpp | 438 ++++++++++++---------------------------
   branches/release/boost/proto/proto_fwd.hpp | 27 ++
   branches/release/boost/proto/traits.hpp | 31 +-
   branches/release/boost/proto/transform/arg.hpp | 10
   branches/release/boost/proto/transform/call.hpp | 2
   branches/release/boost/proto/transform/default.hpp | 18
   branches/release/boost/proto/transform/make.hpp | 24 -
   branches/release/boost/proto/transform/pass_through.hpp | 8
   17 files changed, 283 insertions(+), 411 deletions(-)

Modified: branches/release/boost/proto/context/callable.hpp
==============================================================================
--- branches/release/boost/proto/context/callable.hpp (original)
+++ branches/release/boost/proto/context/callable.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -115,7 +115,7 @@
                 typedef typename proto::result_of::value<Expr const &>::type value_type;
 
                 typedef
- typename boost::result_of<
+ typename boost::tr1_result_of<
                         Context(typename Expr::proto_tag, value_type)
>::type
                 result_type;
@@ -294,7 +294,7 @@
                 BOOST_PP_REPEAT(N, BOOST_PROTO_CHILD_N_TYPE, Expr)
 
                 typedef
- typename boost::result_of<
+ typename boost::tr1_result_of<
                         Context(
                             typename Expr::proto_tag
                             BOOST_PP_ENUM_TRAILING_PARAMS(N, child)

Modified: branches/release/boost/proto/context/default.hpp
==============================================================================
--- branches/release/boost/proto/context/default.hpp (original)
+++ branches/release/boost/proto/context/default.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -152,14 +152,12 @@
             template<typename Expr, typename Context>
             struct is_member_function_eval
               : is_member_function_pointer<
- typename remove_const<
- typename remove_reference<
- typename proto::result_of::eval<
- typename remove_reference<
- typename proto::result_of::child_c<Expr, 1>::type
- >::type
- , Context
+ typename detail::uncvref<
+ typename proto::result_of::eval<
+ typename remove_reference<
+ typename proto::result_of::child_c<Expr, 1>::type
>::type
+ , Context
>::type
>::type
>
@@ -324,7 +322,7 @@
                 function_type;
 
                 typedef
- typename boost::result_of<function_type()>::type
+ typename boost::tr1_result_of<function_type()>::type
                 result_type;
 
                 result_type operator ()(Expr &expr, Context &context) const
@@ -425,7 +423,7 @@
             function_type;
 
             typedef
- typename boost::result_of<
+ typename boost::tr1_result_of<
                     function_type(BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFAULT_EVAL_TYPE, Expr))
>::type
             result_type;

Modified: branches/release/boost/proto/deep_copy.hpp
==============================================================================
--- branches/release/boost/proto/deep_copy.hpp (original)
+++ branches/release/boost/proto/deep_copy.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -41,13 +41,13 @@
                 actual_terminal_type;
 
                 typedef typename terminal<actual_terminal_type>::type expr_type;
- typedef typename Expr::proto_domain proto_domain;
- typedef typename proto_domain::template result<proto_domain(expr_type)>::type result_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
 
                 template<typename Expr2, typename S, typename D>
                 result_type operator()(Expr2 const &e, S const &, D const &) const
                 {
- return typename Expr::proto_domain()(expr_type::make(e.proto_base().child0));
+ return proto_generator()(expr_type::make(e.proto_base().child0));
                 }
             };
         }
@@ -198,8 +198,8 @@
>
                 expr_type;
 
- typedef typename Expr::proto_domain proto_domain;
- typedef typename proto_domain::template result<proto_domain(expr_type)>::type result_type;
+ typedef typename Expr::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
 
                 template<typename Expr2, typename S, typename D>
                 result_type operator()(Expr2 const &e, S const &, D const &) const
@@ -208,7 +208,7 @@
                         BOOST_PP_ENUM(N, BOOST_PROTO_DEFINE_DEEP_COPY_FUN, ~)
                     };
 
- return typename Expr::proto_domain()(that);
+ return proto_generator()(that);
                 }
             };
 

Modified: branches/release/boost/proto/detail/decltype.hpp
==============================================================================
--- branches/release/boost/proto/detail/decltype.hpp (original)
+++ branches/release/boost/proto/detail/decltype.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -22,7 +22,6 @@
 #include <boost/mpl/eval_if.hpp>
 #include <boost/mpl/identity.hpp>
 #include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/remove_cv.hpp>
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/type_traits/is_pointer.hpp>
 #include <boost/type_traits/is_function.hpp>
@@ -337,7 +336,7 @@
             // member object pointers.
             template<typename T, typename Void = void>
             struct result_of_
- : boost::result_of<T>
+ : boost::tr1_result_of<T>
             {};
 
             template<typename T, typename U, typename V>
@@ -391,9 +390,7 @@
             {
                 typedef
                     typename classtypeof<
- typename remove_const<
- typename remove_reference<U>::type
- >::type
+ typename uncvref<U>::type
>::type
                 V;
 
@@ -487,9 +484,9 @@
         template<typename T, typename PMF>
         struct memfun
         {
- typedef typename remove_const<typename remove_reference<PMF>::type>::type pmf_type;
+ typedef typename uncvref<PMF>::type pmf_type;
             typedef typename classtypeof<pmf_type>::type V;
- typedef typename boost::result_of<pmf_type(T)>::type result_type;
+ typedef typename boost::tr1_result_of<pmf_type(T)>::type result_type;
 
             memfun(T t, PMF p)
               : obj(t)

Modified: branches/release/boost/proto/detail/expr0.hpp
==============================================================================
--- branches/release/boost/proto/detail/expr0.hpp (original)
+++ branches/release/boost/proto/detail/expr0.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -57,6 +57,7 @@
         typedef BOOST_PP_CAT(list, BOOST_PP_ITERATION())<BOOST_PP_ENUM_PARAMS(ARG_COUNT, Arg)> proto_args;
         #endif
         typedef default_domain proto_domain;
+ typedef default_generator proto_generator;
         typedef proto::tag::proto_expr fusion_tag;
         typedef expr proto_derived_expr;
         typedef void proto_is_expr_; /**< INTERNAL ONLY */

Modified: branches/release/boost/proto/extends.hpp
==============================================================================
--- branches/release/boost/proto/extends.hpp (original)
+++ branches/release/boost/proto/extends.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -74,8 +74,8 @@
     ///
     #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::result_of< \
- proto_domain( \
+ typename boost::tr1_result_of< \
+ proto_generator( \
                 typename boost::proto::result_of::BOOST_PP_CAT(funop, N)< \
                     proto_derived_expr Const() \
                   , proto_domain \
@@ -90,7 +90,7 @@
               , proto_domain \
                 BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, const A) \
> funop; \
- return proto_domain()( \
+ return proto_generator()( \
                 funop::call( \
                     *static_cast<proto_derived_expr Const() *>(this) \
                     BOOST_PP_ENUM_TRAILING_PARAMS_Z(Z, N, a) \
@@ -103,8 +103,8 @@
     ///
     #define BOOST_PROTO_DEFINE_FUN_OP_VARIADIC_IMPL_(Const) \
         template<typename... A> \
- typename boost::result_of< \
- proto_domain( \
+ typename boost::tr1_result_of< \
+ proto_generator( \
                 typename boost::proto::result_of::funop< \
                     proto_derived_expr Const()(A const &...) \
                   , proto_derived_expr \
@@ -119,7 +119,7 @@
               , proto_derived_expr \
               , proto_domain \
> funop; \
- return proto_domain()( \
+ return proto_generator()( \
                 funop::call( \
                     *static_cast<proto_derived_expr Const() *>(this) \
                   , a... \
@@ -196,12 +196,13 @@
     #define BOOST_PROTO_BASIC_EXTENDS(Expr, Derived, Domain) \
         BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain) \
         typedef void proto_is_aggregate_; \
+ typedef Domain::proto_generator proto_generator; \
         /**< INTERNAL ONLY */
 
     #define BOOST_PROTO_EXTENDS_COPY_ASSIGN_IMPL_(This, Const, Typename) \
         BOOST_PROTO_DISABLE_MSVC_C4522 \
- Typename() boost::result_of< \
- Typename() This::proto_domain( \
+ Typename() boost::tr1_result_of< \
+ Typename() This::proto_generator( \
                 boost::proto::expr< \
                     boost::proto::tag::assign \
                   , boost::proto::list2< \
@@ -226,7 +227,7 @@
                 *this \
               , a \
             }; \
- return Typename() This::proto_domain()(that); \
+ return Typename() This::proto_generator()(that); \
         } \
         /**/
 
@@ -247,8 +248,8 @@
         ///
     #define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
- typename boost::result_of< \
- proto_domain( \
+ typename boost::tr1_result_of< \
+ proto_generator( \
                 boost::proto::expr< \
                     boost::proto::tag::assign \
                   , boost::proto::list2< \
@@ -273,7 +274,7 @@
                 *static_cast<proto_derived_expr ThisConst() *>(this) \
               , boost::proto::as_child<proto_domain>(a) \
             }; \
- return proto_domain()(that); \
+ return proto_generator()(that); \
         } \
         /**/
 
@@ -311,8 +312,8 @@
         ///
     #define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
- typename boost::result_of< \
- proto_domain( \
+ typename boost::tr1_result_of< \
+ proto_generator( \
                 boost::proto::expr< \
                     boost::proto::tag::subscript \
                   , boost::proto::list2< \
@@ -337,7 +338,7 @@
                 *static_cast<proto_derived_expr ThisConst() *>(this) \
               , boost::proto::as_child<proto_domain>(a) \
             }; \
- return proto_domain()(that); \
+ return proto_generator()(that); \
         } \
         /**/
 
@@ -363,8 +364,8 @@
         struct result \
         { \
             typedef \
- typename boost::result_of< \
- proto_domain( \
+ typename boost::tr1_result_of< \
+ proto_generator( \
                         typename boost::proto::result_of::funop< \
                             Sig \
                           , proto_derived_expr \
@@ -497,6 +498,7 @@
 
             typedef extends proto_extends;
             BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain)
+ typedef typename Domain::proto_generator proto_generator;
             BOOST_PROTO_EXTENDS_ASSIGN_CONST_()
             BOOST_PROTO_EXTENDS_SUBSCRIPT_CONST()
 
@@ -541,6 +543,7 @@
 
             typedef extends proto_extends;
             BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain)
+ typedef typename Domain::proto_generator proto_generator;
             BOOST_PROTO_EXTENDS_ASSIGN_()
             BOOST_PROTO_EXTENDS_SUBSCRIPT()
 
@@ -577,6 +580,7 @@
                 expr<tag::member, list2<This &, expr<tag::terminal, term<Fun> > const &>, 2>
             proto_base_expr;
             typedef Domain proto_domain;
+ typedef typename Domain::proto_generator proto_generator;
             typedef virtual_member<This, Fun, Domain> proto_derived_expr;
             typedef typename proto_base_expr::proto_tag proto_tag;
             typedef typename proto_base_expr::proto_args proto_args;

Modified: branches/release/boost/proto/generate.hpp
==============================================================================
--- branches/release/boost/proto/generate.hpp (original)
+++ branches/release/boost/proto/generate.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -99,7 +99,7 @@
                 /// \param expr A Proto expression
                 /// \return expr
                 template<typename Expr>
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                 Expr
                 #else
                 Expr const &
@@ -349,6 +349,12 @@
         {
             typedef Expr type;
         };
+
+ template<typename Expr>
+ struct result_of<proto::default_generator(Expr)>
+ {
+ typedef Expr type;
+ };
     }
 
     #endif // BOOST_PROTO_GENERATE_HPP_EAN_02_13_2007

Modified: branches/release/boost/proto/make_expr.hpp
==============================================================================
--- branches/release/boost/proto/make_expr.hpp (original)
+++ branches/release/boost/proto/make_expr.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -37,8 +37,6 @@
     #include <boost/type_traits/add_const.hpp>
     #include <boost/type_traits/add_reference.hpp>
     #include <boost/type_traits/remove_cv.hpp>
- #include <boost/type_traits/remove_const.hpp>
- #include <boost/type_traits/remove_reference.hpp>
     #include <boost/proto/proto_fwd.hpp>
     #include <boost/proto/traits.hpp>
     #include <boost/proto/domain.hpp>
@@ -868,14 +866,15 @@
               , N
> expr_type;
 
- typedef typename Domain::template result<Domain(expr_type)>::type result_type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type result_type;
 
             result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, typename add_reference<A, >::type a)) const
             {
                 expr_type const that = {
                     BOOST_PP_ENUM(N, BOOST_PROTO_AS_CHILD, (A, a, Domain))
                 };
- return Domain()(that);
+ return proto_generator()(that);
             }
         };
 
@@ -902,7 +901,8 @@
               , N
> expr_type;
 
- typedef typename Domain::template result<Domain(expr_type)>::type type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_type)>::type type;
 
             static type const call(Sequence const &sequence)
             {
@@ -910,7 +910,7 @@
                 expr_type const that = {
                     BOOST_PP_ENUM(N, BOOST_PROTO_FUSION_AS_CHILD_AT, ~)
                 };
- return Domain()(that);
+ return proto_generator()(that);
             }
         };
 

Modified: branches/release/boost/proto/matches.hpp
==============================================================================
--- branches/release/boost/proto/matches.hpp (original)
+++ branches/release/boost/proto/matches.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -323,12 +323,18 @@
 
             template<typename Tag, typename Args1, typename Args2>
             struct matches_< proto::expr<Tag, Args1, 1>, proto::expr<Tag, Args2, 1> >
- : matches_<typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr, typename Args2::child0::proto_base_expr>
+ : matches_<
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr
+ , typename Args2::child0::proto_base_expr
+ >
             {};
 
             template<typename Tag, typename Args1, typename Args2>
             struct matches_< proto::expr<Tag, Args1, 1>, proto::expr<proto::_, Args2, 1> >
- : matches_<typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr, typename Args2::child0::proto_base_expr>
+ : matches_<
+ typename detail::expr_traits<typename Args1::child0>::value_type::proto_base_expr
+ , typename Args2::child0::proto_base_expr
+ >
             {};
 
         #define BOOST_PROTO_MATCHES_N_FUN(Z, N, DATA) \
@@ -377,7 +383,9 @@
 
             template<typename Expr, typename If>
             struct matches_<Expr, proto::if_<If> >
- : detail::uncvref<typename when<_, If>::template impl<Expr, int, int>::result_type>::type
+ : detail::uncvref<
+ typename when<_, If>::template impl<Expr, int, int>::result_type
+ >::type
             {};
 
             // handle degenerate cases of proto::or_
@@ -560,7 +568,7 @@
 
                     /// \param expr An expression
                     /// \return \c e
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                     result_type
                     #else
                     typename impl::expr_param
@@ -612,7 +620,7 @@
                     /// \param e An expression
                     /// \pre <tt>matches\<Expr,not_\>::::value</tt> is \c true.
                     /// \return \c e
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                     result_type
                     #else
                     typename impl::expr_param
@@ -1020,14 +1028,20 @@
             template<typename Args, typename Back, long To>
             struct vararg_matches_impl<Args, Back, N, To>
               : and_2<
- matches_<typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr, Back>::value
+ matches_<
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr
+ , Back
+ >::value
                   , vararg_matches_impl<Args, Back, N + 1, To>
>
             {};
 
             template<typename Args, typename Back>
             struct vararg_matches_impl<Args, Back, N, N>
- : matches_<typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr, Back>
+ : matches_<
+ typename detail::expr_traits<typename Args::BOOST_PP_CAT(child, BOOST_PP_DEC(N))>::value_type::proto_base_expr
+ , Back
+ >
             {};
 
             template<
@@ -1035,7 +1049,11 @@
                 BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Expr)
                 BOOST_PP_ENUM_TRAILING_PARAMS(N, typename Grammar)
>
- struct lambda_matches<T<BOOST_PP_ENUM_PARAMS(N, Expr)>, T<BOOST_PP_ENUM_PARAMS(N, Grammar)> BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(N) >
+ struct lambda_matches<
+ T<BOOST_PP_ENUM_PARAMS(N, Expr)>
+ , T<BOOST_PP_ENUM_PARAMS(N, Grammar)>
+ BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(N)
+ >
               : BOOST_PP_CAT(and_, N)<
                     BOOST_PROTO_DEFINE_LAMBDA_MATCHES(~, 0, ~)::value,
                     BOOST_PP_ENUM_SHIFTED(N, BOOST_PROTO_DEFINE_LAMBDA_MATCHES, ~)

Modified: branches/release/boost/proto/operators.hpp
==============================================================================
--- branches/release/boost/proto/operators.hpp (original)
+++ branches/release/boost/proto/operators.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -11,10 +11,8 @@
 #define BOOST_PROTO_OPERATORS_HPP_EAN_04_01_2005
 
 #include <boost/preprocessor/punctuation/comma.hpp>
-#include <boost/preprocessor/seq/seq.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/assert.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/mpl/logical.hpp>
+#include <boost/utility/enable_if.hpp>
 #include <boost/proto/proto_fwd.hpp>
 #include <boost/proto/tags.hpp>
 #include <boost/proto/expr.hpp>
@@ -27,189 +25,65 @@
 {
     namespace detail
     {
- template<typename Domain, typename Expr, typename EnableIf = void>
- struct generate_if
- : lazy_enable_if_c<
- matches<Expr, typename Domain::proto_grammar>::value
- , typename Domain::template result<Domain(Expr)>
- >
- {};
-
- // Optimization, generate fewer templates...
- template<typename Expr>
- struct generate_if<proto::default_domain, Expr, void>
- {
- typedef Expr type;
- };
-
- template<typename Domain, typename Tag, typename Left, typename Right>
- struct generate_if_left
- : lazy_enable_if_c<
- matches<proto::expr<Tag, proto::list2<Left &, Right>, 2>, typename Domain::proto_grammar>::value
- , typename Domain::template result<Domain(
- proto::expr<Tag, proto::list2<Left &, typename Domain::template result<Domain(Right)>::type>, 2>
- )>
- >
- {};
-
- // Optimization, generate fewer templates...
- template<typename Tag, typename Left, typename Right>
- struct generate_if_left<proto::default_domain, Tag, Left, Right>
- {
- typedef proto::expr<Tag, proto::list2<Left &, Right>, 2> type;
- };
-
- template<typename Domain, typename Tag, typename Left, typename Right>
- struct generate_if_right
- : lazy_enable_if_c<
- matches<proto::expr<Tag, proto::list2<Left, Right &>, 2>, typename Domain::proto_grammar>::value
- , typename Domain::template result<Domain(
- proto::expr<Tag, proto::list2<typename Domain::template result<Domain(Left)>::type, Right &>, 2>
- )>
- >
- {};
-
- // Optimization, generate fewer templates...
- template<typename Tag, typename Left, typename Right>
- struct generate_if_right<proto::default_domain, Tag, Left, Right>
- {
- typedef proto::expr<Tag, proto::list2<Left, Right &>, 2> type;
- };
-
- template<typename Tag, typename Left, typename Right, typename Enable1 = void, typename Enable2 = void>
- struct as_expr_if2
+ template<typename MakeExpr, typename Grammar>
+ struct lazy_matches
+ : proto::matches<typename MakeExpr::type, Grammar>
         {};
 
- template<typename Tag, typename Left, typename Right>
- struct as_expr_if2<Tag, Left, Right, typename Left::proto_is_expr_, void>
- : generate_if_left<
- typename Left::proto_domain
- , Tag
- , Left
- , proto::expr<tag::terminal, term<Right &>, 0>
- >
- {
- typedef proto::expr<tag::terminal, term<Right &>, 0> term_type;
- typedef typename Left::proto_domain proto_domain;
- typedef proto::expr<Tag, list2<Left &, typename proto_domain::template result<proto_domain(term_type)>::type>, 2> expr_type;
-
- static typename proto_domain::template result<proto_domain(expr_type)>::type
- make(Left &left, Right &right)
- {
- term_type const term = {right};
- expr_type const that = {left, proto_domain()(term)};
- return proto_domain()(that);
- }
- };
-
- template<typename Tag, typename Left, typename Right>
- struct as_expr_if2<Tag, Left, Right, void, typename Right::proto_is_expr_>
- : generate_if_right<
- typename Right::proto_domain
- , Tag
- , proto::expr<tag::terminal, term<Left &>, 0>
- , Right
- >
- {
- typedef proto::expr<tag::terminal, term<Left &>, 0> term_type;
- typedef typename Right::proto_domain proto_domain;
- typedef proto::expr<Tag, list2<typename proto_domain::template result<proto_domain(term_type)>::type, Right &>, 2> expr_type;
-
- static typename proto_domain::template result<proto_domain(expr_type)>::type
- make(Left &left, Right &right)
- {
- term_type const term = {left};
- expr_type const that = {proto_domain()(term), right};
- return proto_domain()(that);
- }
- };
-
- template<typename Tag, typename Left, typename Right, typename Enable1 = void, typename Enable2 = void>
- struct as_expr_if
- : as_expr_if2<Tag, Left, Right>
- {};
-
- template<typename Tag, typename Left, typename Right>
- struct as_expr_if<Tag, Left, Right, typename Left::proto_is_expr_, typename Right::proto_is_expr_>
- : generate_if<
- typename common_domain2<typename Left::proto_domain, typename Right::proto_domain>::type
- , proto::expr<Tag, list2<Left &, Right &>, 2>
- >
- {
- typedef proto::expr<Tag, list2<Left &, Right &>, 2> expr_type;
- typedef typename common_domain2<typename Left::proto_domain, typename Right::proto_domain>::type proto_domain;
-
- static typename proto_domain::template result<proto_domain(expr_type)>::type
- make(Left &left, Right &right)
- {
- expr_type const that = {left, right};
- return proto_domain()(that);
- }
- };
-
- template<typename Arg, typename Trait, typename Enable = void>
- struct arg_weight
- {
- BOOST_STATIC_CONSTANT(int, value = 1 + Trait::value);
- };
-
- template<typename Arg, typename Trait>
- struct arg_weight<Arg, Trait, typename Arg::proto_is_expr_>
- {
- BOOST_STATIC_CONSTANT(int, value = 0);
- };
-
- template<typename Domain, typename Trait, typename Arg, typename Expr>
+ template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Arg>
         struct enable_unary
- : boost::enable_if_c<
- boost::mpl::and_<Trait, boost::proto::matches<Expr, typename Domain::proto_grammar> >::value
- , Expr
- >
- {};
-
- template<typename Trait, typename Arg, typename Expr>
- struct enable_unary<deduce_domain, Trait, Arg, Expr>
- : boost::enable_if_c<
+ : boost::lazy_enable_if_c<
                 boost::mpl::and_<
                     Trait
- , boost::proto::matches<Expr, typename domain_of<Arg>::type::proto_grammar>
+ , lazy_matches<result_of::make_expr<Tag, Domain, Arg &>, Grammar>
>::value
- , Expr
+ , result_of::make_expr<Tag, Domain, Arg &>
>
         {};
 
- template<typename Trait, typename Arg, typename Expr>
- struct enable_unary<default_domain, Trait, Arg, Expr>
- : boost::enable_if_c<Trait::value, Expr>
+ template<typename Domain, typename Trait, typename Tag, typename Arg>
+ struct enable_unary<Domain, proto::_, Trait, Tag, Arg>
+ : boost::lazy_enable_if_c<Trait::value, result_of::make_expr<Tag, Domain, Arg &> >
         {};
 
- template<typename Domain, typename Trait1, typename Arg1, typename Trait2, typename Arg2, typename Expr>
- struct enable_binary
- : boost::enable_if_c<
- boost::mpl::and_<
- mpl::bool_<(3 <= (arg_weight<Arg1, Trait1>::value + arg_weight<Arg2, Trait2>::value))>
- , boost::proto::matches<Expr, typename Domain::proto_grammar>
- >::value
- , Expr
+ template<typename Trait, typename Tag, typename Arg>
+ struct enable_unary<deduce_domain, not_a_grammar, Trait, Tag, Arg>
+ : enable_unary<
+ typename domain_of<Arg>::type
+ , typename domain_of<Arg>::type::proto_grammar
+ , Trait
+ , Tag
+ , Arg
>
         {};
 
- template<typename Trait1, typename Arg1, typename Trait2, typename Arg2, typename Expr>
- struct enable_binary<deduce_domain, Trait1, Arg1, Trait2, Arg2, Expr>
- : boost::enable_if_c<
+ template<typename Domain, typename Grammar, typename Trait, typename Tag, typename Left, typename Right>
+ struct enable_binary
+ : boost::lazy_enable_if_c<
                 boost::mpl::and_<
- mpl::bool_<(3 <= (arg_weight<Arg1, Trait1>::value + arg_weight<Arg2, Trait2>::value))>
- , boost::proto::matches<Expr, typename deduce_domain2<Arg1, Arg2>::type::proto_grammar>
+ Trait
+ , lazy_matches<proto::result_of::as_child<Left>, Grammar>
+ , lazy_matches<proto::result_of::as_child<Right>, Grammar>
+ , lazy_matches<result_of::make_expr<Tag, Domain, Left &, Right &>, Grammar>
>::value
- , Expr
+ , result_of::make_expr<Tag, Domain, Left &, Right &>
>
         {};
 
- template<typename Trait1, typename Arg1, typename Trait2, typename Arg2, typename Expr>
- struct enable_binary<default_domain, Trait1, Arg1, Trait2, Arg2, Expr>
- : boost::enable_if_c<
- (3 <= (arg_weight<Arg1, Trait1>::value + arg_weight<Arg2, Trait2>::value))
- , Expr
+ template<typename Domain, typename Trait, typename Tag, typename Left, typename Right>
+ struct enable_binary<Domain, proto::_, Trait, Tag, Left, Right>
+ : boost::lazy_enable_if_c<Trait::value, result_of::make_expr<Tag, Domain, Left &, Right &> >
+ {};
+
+ template<typename Trait, typename Tag, typename Left, typename Right>
+ struct enable_binary<deduce_domain, not_a_grammar, Trait, Tag, Left, Right>
+ : enable_binary<
+ typename deduce_domain2<Left, Right>::type
+ , typename deduce_domain2<Left, Right>::type::proto_grammar
+ , Trait
+ , Tag
+ , Left
+ , Right
>
         {};
 
@@ -218,133 +92,27 @@
 #define BOOST_PROTO_UNARY_OP_IS_POSTFIX_0
 #define BOOST_PROTO_UNARY_OP_IS_POSTFIX_1 , int
 
-#define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, POST) \
- template<typename Arg> \
- typename detail::generate_if< \
- typename Arg::proto_domain \
- , proto::expr<TAG, list1<Arg &>, 1> \
- , typename Arg::proto_is_expr_ \
- >::type const \
- operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
- { \
- typedef proto::expr<TAG, list1<Arg &>, 1> that_type; \
- that_type const that = {arg}; \
- return typename Arg::proto_domain()(that); \
- } \
- template<typename Arg> \
- typename detail::generate_if< \
- typename Arg::proto_domain \
- , proto::expr<TAG, list1<Arg const &>, 1> \
- , typename Arg::proto_is_expr_ \
- >::type const \
- operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
- { \
- typedef proto::expr<TAG, list1<Arg const &>, 1> that_type; \
- that_type const that = {arg}; \
- return typename Arg::proto_domain()(that); \
- } \
- /**/
-
-#define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG) \
- template<typename Left, typename Right> \
- inline typename detail::as_expr_if<TAG, Left, Right>::type const \
- operator OP(Left &left, Right &right) \
- { \
- return detail::as_expr_if<TAG, Left, Right>::make(left, right); \
- } \
- template<typename Left, typename Right> \
- inline typename detail::as_expr_if<TAG, Left, Right const>::type const \
- operator OP(Left &left, Right const &right) \
- { \
- return detail::as_expr_if<TAG, Left, Right const>::make(left, right); \
- } \
- template<typename Left, typename Right> \
- inline typename detail::as_expr_if<TAG, Left const, Right>::type const \
- operator OP(Left const &left, Right &right) \
- { \
- return detail::as_expr_if<TAG, Left const, Right>::make(left, right); \
- } \
- template<typename Left, typename Right> \
- inline typename detail::as_expr_if<TAG, Left const, Right const>::type const \
- operator OP(Left const &left, Right const &right) \
- { \
- return detail::as_expr_if<TAG, Left const, Right const>::make(left, right); \
- } \
- /**/
-
- namespace exprns_
- {
-
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(+, tag::unary_plus, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(-, tag::negate, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(*, tag::dereference, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(~, tag::complement, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(&, tag::address_of, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(!, tag::logical_not, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, tag::pre_inc, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, tag::pre_dec, 0)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(++, tag::post_inc, 1)
- BOOST_PROTO_DEFINE_UNARY_OPERATOR(--, tag::post_dec, 1)
-
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<, tag::shift_left)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>, tag::shift_right)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(*, tag::multiplies)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(/, tag::divides)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(%, tag::modulus)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(+, tag::plus)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(-, tag::minus)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(<, tag::less)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(>, tag::greater)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(<=, tag::less_equal)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(>=, tag::greater_equal)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(==, tag::equal_to)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(!=, tag::not_equal_to)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(||, tag::logical_or)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(&&, tag::logical_and)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(&, tag::bitwise_and)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(|, tag::bitwise_or)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(^, tag::bitwise_xor)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(BOOST_PP_COMMA(), tag::comma)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(->*, tag::mem_ptr)
-
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(<<=, tag::shift_left_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(>>=, tag::shift_right_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(*=, tag::multiplies_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(/=, tag::divides_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(%=, tag::modulus_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(+=, tag::plus_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(-=, tag::minus_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(&=, tag::bitwise_and_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(|=, tag::bitwise_or_assign)
- BOOST_PROTO_DEFINE_BINARY_OPERATOR(^=, tag::bitwise_xor_assign)
-
- /// if_else
- ///
- template<typename A0, typename A1, typename A2>
- typename functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>::result_type const
- if_else(A0 const &a0, A1 const &a1, A2 const &a2)
- {
- return functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>()(a0, a1, a2);
- }
- }
-
- using exprns_::if_else;
-
-#undef BOOST_PROTO_DEFINE_UNARY_OPERATOR
-#undef BOOST_PROTO_DEFINE_BINARY_OPERATOR
-
 #define BOOST_PROTO_DEFINE_UNARY_OPERATOR(OP, TAG, TRAIT, DOMAIN, POST) \
     template<typename Arg> \
- typename boost::proto::detail::enable_unary<DOMAIN, TRAIT<Arg>, Arg \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg &>::result_type \
+ typename boost::proto::detail::enable_unary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \
+ , TAG \
+ , Arg \
>::type const \
     operator OP(Arg &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
         return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg &>()(arg); \
     } \
+ \
     template<typename Arg> \
- typename boost::proto::detail::enable_unary<DOMAIN, TRAIT<Arg>, Arg \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Arg const &>::result_type \
+ typename boost::proto::detail::enable_unary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_UNARY_(TRAIT, Arg) \
+ , TAG \
+ , Arg const \
>::type const \
     operator OP(Arg const &arg BOOST_PROTO_UNARY_OP_IS_POSTFIX_ ## POST) \
     { \
@@ -354,36 +122,63 @@
 
 #define BOOST_PROTO_DEFINE_BINARY_OPERATOR(OP, TAG, TRAIT, DOMAIN) \
     template<typename Left, typename Right> \
- typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right &>::result_type\
+ typename boost::proto::detail::enable_binary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
+ , TAG \
+ , Left \
+ , Right \
>::type const \
     operator OP(Left &left, Right &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right &>()(left, right);\
+ return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
+ impl<Left &, Right &>()(left, right); \
     } \
+ \
     template<typename Left, typename Right> \
- typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right const &>::result_type\
+ typename boost::proto::detail::enable_binary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
+ , TAG \
+ , Left \
+ , Right const \
>::type const \
     operator OP(Left &left, Right const &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left &, Right const &>()(left, right);\
+ return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
+ impl<Left &, Right const &>()(left, right); \
     } \
+ \
     template<typename Left, typename Right> \
- typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right &>::result_type\
+ typename boost::proto::detail::enable_binary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
+ , TAG \
+ , Left const \
+ , Right \
>::type const \
     operator OP(Left const &left, Right &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right &>()(left, right);\
+ return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
+ impl<Left const &, Right &>()(left, right); \
     } \
+ \
     template<typename Left, typename Right> \
- typename boost::proto::detail::enable_binary<DOMAIN, TRAIT<Left>, Left, TRAIT<Right>, Right \
- , typename boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right const &>::result_type\
+ typename boost::proto::detail::enable_binary< \
+ DOMAIN \
+ , DOMAIN::proto_grammar \
+ , BOOST_PROTO_APPLY_BINARY_(TRAIT, Left, Right) \
+ , TAG \
+ , Left const \
+ , Right const \
>::type const \
     operator OP(Left const &left, Right const &right) \
     { \
- return boost::proto::functional::make_expr<TAG, DOMAIN>::impl<Left const &, Right const &>()(left, right);\
+ return boost::proto::functional::make_expr<TAG, DOMAIN>:: \
+ impl<Left const &, Right const &>()(left, right); \
     } \
     /**/
 
@@ -430,17 +225,54 @@
     BOOST_PROTO_DEFINE_BINARY_OPERATOR(^=, boost::proto::tag::bitwise_xor_assign, TRAIT, DOMAIN) \
     /**/
 
+ // Extensions are a superset of Proto expressions
     template<typename T>
     struct is_extension
- : mpl::false_
+ : is_expr<T>
     {};
 
- namespace exops
+ #define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) TRAIT<ARG>
+ #define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> >
+
+ namespace exprns_
     {
- BOOST_PROTO_DEFINE_OPERATORS(is_extension, default_domain)
- using proto::if_else;
+ // This defines all of Proto's built-in free operator overloads
+ BOOST_PROTO_DEFINE_OPERATORS(is_extension, deduce_domain)
+
+ // if_else, for the non-overloadable ternary conditional operator ?:
+ template<typename A0, typename A1, typename A2>
+ typename result_of::make_expr<tag::if_else_, deduce_domain, A0 const &, A1 const &, A2 const &>::type const
+ if_else(A0 const &a0, A1 const &a1, A2 const &a2)
+ {
+ return functional::make_expr<tag::if_else_>::impl<A0 const &, A1 const &, A2 const &>()(a0, a1, a2);
+ }
     }
 
+ using exprns_::if_else;
+
+ #undef BOOST_PROTO_APPLY_UNARY_
+ #undef BOOST_PROTO_APPLY_BINARY_
+
+ // Redefine BOOST_PROTO_APPLY_UNARY_ and BOOST_PROTO_APPLY_BINARY_ so that end users
+ // can use BOOST_PROTO_DEFINE_OPERATORS to define Proto operator overloads that work
+ // with their own terminal types.
+
+ #define BOOST_PROTO_APPLY_UNARY_(TRAIT, ARG) \
+ boost::mpl::and_<TRAIT<ARG>, boost::mpl::not_<boost::proto::is_extension<ARG> > > \
+ /**/
+
+ #define BOOST_PROTO_APPLY_BINARY_(TRAIT, LEFT, RIGHT) \
+ boost::mpl::and_< \
+ boost::mpl::or_<TRAIT<LEFT>, TRAIT<RIGHT> > \
+ , boost::mpl::not_< \
+ boost::mpl::or_< \
+ boost::proto::is_extension<LEFT> \
+ , boost::proto::is_extension<RIGHT> \
+ > \
+ > \
+ > \
+ /**/
+
 }}
 
 #endif

Modified: branches/release/boost/proto/proto_fwd.hpp
==============================================================================
--- branches/release/boost/proto/proto_fwd.hpp (original)
+++ branches/release/boost/proto/proto_fwd.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -122,6 +122,24 @@
             typedef T type;
         };
 
+ template<typename T, std::size_t N>
+ struct uncvref<T const[N]>
+ {
+ typedef T type[N];
+ };
+
+ template<typename T, std::size_t N>
+ struct uncvref<T (&)[N]>
+ {
+ typedef T type[N];
+ };
+
+ template<typename T, std::size_t N>
+ struct uncvref<T const (&)[N]>
+ {
+ typedef T type[N];
+ };
+
         struct ignore
         {
             ignore()
@@ -135,7 +153,8 @@
         /// INTERNAL ONLY
         ///
         #define BOOST_PROTO_UNCVREF(X) \
- typename boost::remove_const<typename boost::remove_reference<X>::type>::type
+ typename boost::proto::detail::uncvref<X>::type \
+ /**/
 
         struct _default;
 
@@ -752,8 +771,10 @@
     template<typename T>
     struct is_extension;
 
- namespace exops
- {}
+ //namespace exops
+ //{}
+
+ namespace exops = exprns_;
 
 }} // namespace boost::proto
 

Modified: branches/release/boost/proto/traits.hpp
==============================================================================
--- branches/release/boost/proto/traits.hpp (original)
+++ branches/release/boost/proto/traits.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -37,7 +37,6 @@
     #include <boost/type_traits/is_same.hpp>
     #include <boost/type_traits/is_function.hpp>
     #include <boost/type_traits/remove_cv.hpp>
- #include <boost/type_traits/remove_const.hpp>
     #include <boost/type_traits/add_reference.hpp>
     #include <boost/proto/proto_fwd.hpp>
     #include <boost/proto/args.hpp>
@@ -256,7 +255,8 @@
>::type
                 arg0_;
                 typedef proto::expr<proto::tag::terminal, term<arg0_>, 0> expr_;
- typedef typename Domain::template result<Domain(expr_)>::type type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<Domain(expr_)>::type type;
                 typedef type const reference;
 
                 /// INTERNAL ONLY
@@ -264,7 +264,7 @@
                 template<typename T2>
                 static reference call(T2 &t)
                 {
- return Domain()(expr_::make(t));
+ return proto_generator()(expr_::make(t));
                 }
             };
 
@@ -289,7 +289,8 @@
>
             {
                 typedef typename T::proto_derived_expr expr_; // removes the const
- typedef typename Domain::template result<Domain(expr_)>::type type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_)>::type type;
                 typedef type const reference;
 
                 /// INTERNAL ONLY
@@ -297,7 +298,7 @@
                 template<typename T2>
                 static reference call(T2 &t)
                 {
- return Domain()(t);
+ return proto_generator()(t);
                 }
             };
 
@@ -344,14 +345,15 @@
             struct as_child
             {
                 typedef proto::expr<proto::tag::terminal, term<T &>, 0> expr_;
- typedef typename Domain::template result<Domain(expr_)>::type type;
+ typedef typename Domain::proto_generator proto_generator;
+ typedef typename proto_generator::template result<proto_generator(expr_)>::type type;
 
                 /// INTERNAL ONLY
                 ///
                 template<typename T2>
                 static type call(T2 &t)
                 {
- return Domain()(expr_::make(t));
+ return proto_generator()(expr_::make(t));
                 }
             };
 
@@ -375,14 +377,19 @@
               #endif
>
             {
+ typedef typename Domain::proto_generator proto_generator;
                 // BUGBUG should be able to hold this guy by reference, no?
                 #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || \
                     BOOST_WORKAROUND(BOOST_INTEL, BOOST_TESTED_AT(1010))
                 // These compilers don't strip top-level cv qualifiers
                 // on arguments in function types
- typedef typename Domain::template result<Domain(typename T::proto_derived_expr)>::type type;
+ typedef
+ typename proto_generator::template result<
+ proto_generator(typename T::proto_derived_expr)
+ >::type
+ type;
                 #else
- typedef typename Domain::template result<Domain(T)>::type type;
+ typedef typename proto_generator::template result<proto_generator(T)>::type type;
                 #endif
 
                 /// INTERNAL ONLY
@@ -390,7 +397,7 @@
                 template<typename T2>
                 static type call(T2 &t)
                 {
- return Domain()(t);
+ return proto_generator()(t);
                 }
             };
 
@@ -542,7 +549,7 @@
                     /// \pre <tt>matches\<Expr, terminal\<T\> \>::::value</tt> is \c true.
                     /// \return \c e
                     /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                     result_type
                     #else
                     typename impl::expr_param
@@ -612,7 +619,7 @@
                     /// \pre <tt>matches\<Expr, nullary_expr\<Tag, T\> \>::::value</tt> is \c true.
                     /// \return \c e
                     /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                     result_type
                     #else
                     typename impl::expr_param

Modified: branches/release/boost/proto/transform/arg.hpp
==============================================================================
--- branches/release/boost/proto/transform/arg.hpp (original)
+++ branches/release/boost/proto/transform/arg.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -38,7 +38,7 @@
             /// \param e The current expression.
             /// \return \c e
             /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
             result_type
             #else
             typename impl::expr_param
@@ -75,7 +75,7 @@
             /// \param s The current state.
             /// \return \c s
             /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
             result_type
             #else
             typename impl::state_param
@@ -113,7 +113,7 @@
             /// \param d The current data.
             /// \return \c d
             /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
             result_type
             #else
             typename impl::data_param
@@ -154,7 +154,7 @@
             /// \param e The current expression.
             /// \return <tt>proto::child_c\<N\>(e)</tt>
             /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
             result_type
             #else
             typename result_of::child_c<typename impl::expr_param, N>::type
@@ -194,7 +194,7 @@
             /// \param e The current expression.
             /// \return <tt>proto::value(e)</tt>
             /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
             typename mpl::if_c<is_array<result_type>::value, result_type &, result_type>::type
             #else
             typename result_of::value<typename impl::expr_param>::type

Modified: branches/release/boost/proto/transform/call.hpp
==============================================================================
--- branches/release/boost/proto/transform/call.hpp (original)
+++ branches/release/boost/proto/transform/call.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -91,7 +91,7 @@
             struct impl2
               : transform_impl<Expr, State, Data>
             {
- typedef typename boost::result_of<Fun()>::type result_type;
+ typedef typename boost::tr1_result_of<Fun()>::type result_type;
 
                 result_type operator()(
                     typename impl2::expr_param

Modified: branches/release/boost/proto/transform/default.hpp
==============================================================================
--- branches/release/boost/proto/transform/default.hpp (original)
+++ branches/release/boost/proto/transform/default.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -171,14 +171,12 @@
             template<typename Grammar, typename Expr, typename State, typename Data>
             struct is_member_function_invocation
               : is_member_function_pointer<
- typename remove_const<
- typename remove_reference<
- typename Grammar::template impl<
- typename result_of::child_c<Expr, 1>::type
- , State
- , Data
- >::result_type
- >::type
+ typename uncvref<
+ typename Grammar::template impl<
+ typename result_of::child_c<Expr, 1>::type
+ , State
+ , Data
+ >::result_type
>::type
>
             {};
@@ -482,7 +480,7 @@
                 function_type;
 
                 typedef
- typename boost::result_of<function_type()>::type
+ typename boost::tr1_result_of<function_type()>::type
                 result_type;
 
                 result_type operator ()(
@@ -615,7 +613,7 @@
             function_type;
 
             typedef
- typename boost::result_of<
+ typename boost::tr1_result_of<
                     function_type(BOOST_PP_ENUM_SHIFTED_PARAMS(N, r))
>::type
             result_type;

Modified: branches/release/boost/proto/transform/make.hpp
==============================================================================
--- branches/release/boost/proto/transform/make.hpp (original)
+++ branches/release/boost/proto/transform/make.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -26,8 +26,6 @@
     #include <boost/mpl/aux_/template_arity.hpp>
     #include <boost/mpl/aux_/lambda_arity_param.hpp>
     #include <boost/utility/result_of.hpp>
- #include <boost/type_traits/remove_const.hpp>
- #include <boost/type_traits/remove_reference.hpp>
     #include <boost/proto/proto_fwd.hpp>
     #include <boost/proto/traits.hpp>
     #include <boost/proto/args.hpp>
@@ -96,11 +94,7 @@
             // TODO could optimize this if R is a transform
             template<typename R, typename Expr, typename State, typename Data>
             struct make_if_<R, Expr, State, Data, true>
- : remove_const<
- typename remove_reference<
- typename R::template impl<Expr, State, Data>::result_type
- >::type
- >
+ : uncvref<typename R::template impl<Expr, State, Data>::result_type>
             {};
 
             template<typename Type, bool IsAggregate = is_aggregate<Type>::value>
@@ -335,11 +329,9 @@
             struct make_if_<R(BOOST_PP_ENUM_PARAMS(N, A)), Expr, State, Data, false>
             {
                 typedef
- typename remove_const<
- typename remove_reference<
- typename when<_, R(BOOST_PP_ENUM_PARAMS(N, A))>
- ::template impl<Expr, State, Data>::result_type
- >::type
+ typename uncvref<
+ typename when<_, R(BOOST_PP_ENUM_PARAMS(N, A))>
+ ::template impl<Expr, State, Data>::result_type
>::type
                 type;
             };
@@ -352,11 +344,9 @@
             struct make_if_<R(*)(BOOST_PP_ENUM_PARAMS(N, A)), Expr, State, Data, false>
             {
                 typedef
- typename remove_const<
- typename remove_reference<
- typename when<_, R(BOOST_PP_ENUM_PARAMS(N, A))>
- ::template impl<Expr, State, Data>::result_type
- >::type
+ typename uncvref<
+ typename when<_, R(BOOST_PP_ENUM_PARAMS(N, A))>
+ ::template impl<Expr, State, Data>::result_type
>::type
                 type;
             };

Modified: branches/release/boost/proto/transform/pass_through.hpp
==============================================================================
--- branches/release/boost/proto/transform/pass_through.hpp (original)
+++ branches/release/boost/proto/transform/pass_through.hpp 2010-06-07 12:57:07 EDT (Mon, 07 Jun 2010)
@@ -69,7 +69,7 @@
                 /// \param e An expression
                 /// \return \c e
                 /// \throw nothrow
- #ifndef BOOST_NO_DECLTYPE
+ #ifdef BOOST_PROTO_STRICT_RESULT_OF
                 result_type
                 #else
                 typename pass_through_impl::expr_param
@@ -175,8 +175,8 @@
                   , N
> expr_type;
 
- typedef typename unref_expr::proto_domain proto_domain;
- typedef typename boost::result_of<proto_domain(expr_type)>::type result_type;
+ typedef typename unref_expr::proto_generator proto_generator;
+ typedef typename boost::tr1_result_of<proto_generator(expr_type)>::type result_type;
 
                 result_type const operator ()(
                     typename pass_through_impl::expr_param e
@@ -193,7 +193,7 @@
                     // built with VC8.
                     &that;
                     #endif
- return proto_domain()(that);
+ return proto_generator()(that);
                 }
             };
 


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