Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58401 - in trunk/boost/proto: . context transform
From: eric_at_[hidden]
Date: 2009-12-15 17:29:10


Author: eric_niebler
Date: 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
New Revision: 58401
URL: http://svn.boost.org/trac/boost/changeset/58401

Log:
more appropriate use of ellipses when a really bad conversion sequence is needed
Text files modified:
   trunk/boost/proto/context/callable.hpp | 36 +++++++++++++-----------------------
   trunk/boost/proto/make_expr.hpp | 3 +--
   trunk/boost/proto/proto_fwd.hpp | 2 +-
   trunk/boost/proto/transform/call.hpp | 1 -
   trunk/boost/proto/transform/when.hpp | 10 +++-------
   5 files changed, 18 insertions(+), 34 deletions(-)

Modified: trunk/boost/proto/context/callable.hpp
==============================================================================
--- trunk/boost/proto/context/callable.hpp (original)
+++ trunk/boost/proto/context/callable.hpp 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
@@ -36,21 +36,29 @@
     {
         namespace detail
         {
+ template<typename Context>
+ struct callable_context_wrapper
+ : remove_cv<Context>::type
+ {
+ callable_context_wrapper();
+ typedef private_type_ fun_type(...);
+ operator fun_type *() const;
+ private:
+ callable_context_wrapper &operator =(callable_context_wrapper const &);
+ };
+
             template<typename T>
             yes_type check_is_expr_handled(T const &);
 
             no_type check_is_expr_handled(private_type_ const &);
 
- template<typename Context, long Arity>
- struct callable_context_wrapper;
-
             template<typename Expr, typename Context, long Arity = Expr::proto_arity_c>
             struct is_expr_handled;
 
             template<typename Expr, typename Context>
             struct is_expr_handled<Expr, Context, 0>
             {
- static callable_context_wrapper<Context, 1> &sctx_;
+ static callable_context_wrapper<Context> &sctx_;
                 static Expr &sexpr_;
                 static typename Expr::proto_tag &stag_;
 
@@ -243,28 +251,10 @@
 
         namespace detail
         {
- template<typename Context>
- struct callable_context_wrapper<Context, N>
- : remove_cv<Context>::type
- {
- callable_context_wrapper();
- typedef
- private_type_ const &fun_type(
- BOOST_PP_ENUM_PARAMS(
- BOOST_PP_INC(N)
- , detail::dont_care BOOST_PP_INTERCEPT
- )
- );
- operator fun_type *() const;
-
- private:
- callable_context_wrapper &operator =(callable_context_wrapper const &);
- };
-
             template<typename Expr, typename Context>
             struct is_expr_handled<Expr, Context, N>
             {
- static callable_context_wrapper<Context, N> &sctx_;
+ static callable_context_wrapper<Context> &sctx_;
                 static Expr &sexpr_;
                 static typename Expr::proto_tag &stag_;
 

Modified: trunk/boost/proto/make_expr.hpp
==============================================================================
--- trunk/boost/proto/make_expr.hpp (original)
+++ trunk/boost/proto/make_expr.hpp 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
@@ -930,8 +930,7 @@
             type;
             #else
             #define M0(N, F) char (&F)[BOOST_PP_INC(N)]
- static M0(BOOST_PROTO_MAX_ARITY, deducer(
- BOOST_PP_ENUM_PARAMS(N, dont_care BOOST_PP_INTERCEPT)));
+ static M0(BOOST_PROTO_MAX_ARITY, deducer(...));
             #define M1(Z, X, DATA) \
             typedef typename domain_of<BOOST_PP_CAT(A, X)>::type BOOST_PP_CAT(D, X); \
             static BOOST_PP_CAT(D, X) &BOOST_PP_CAT(d, X); \

Modified: trunk/boost/proto/proto_fwd.hpp
==============================================================================
--- trunk/boost/proto/proto_fwd.hpp (original)
+++ trunk/boost/proto/proto_fwd.hpp 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
@@ -95,7 +95,7 @@
 
         struct private_type_
         {
- private_type_ const &operator ,(int) const;
+ private_type_ operator ,(int) const;
         };
 
         template<typename T>

Modified: trunk/boost/proto/transform/call.hpp
==============================================================================
--- trunk/boost/proto/transform/call.hpp (original)
+++ trunk/boost/proto/transform/call.hpp 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
@@ -23,7 +23,6 @@
     #include <boost/proto/proto_fwd.hpp>
     #include <boost/proto/traits.hpp>
     #include <boost/proto/transform/impl.hpp>
- #include <boost/proto/detail/dont_care.hpp>
     #include <boost/proto/detail/as_lvalue.hpp>
     #include <boost/proto/detail/poly_function.hpp>
 

Modified: trunk/boost/proto/transform/when.hpp
==============================================================================
--- trunk/boost/proto/transform/when.hpp (original)
+++ trunk/boost/proto/transform/when.hpp 2009-12-15 17:29:09 EST (Tue, 15 Dec 2009)
@@ -146,16 +146,12 @@
             template<typename Expr, typename State, typename Data>
             struct impl : transform_impl<Expr, State, Data>
             {
- typedef call<R(BOOST_PP_ENUM_PARAMS(N, A))> call_;
- typedef make<R(BOOST_PP_ENUM_PARAMS(N, A))> make_;
-
+ // OK to evaluate is_callable<R> here. R should be compete by now.
                 typedef
                     typename mpl::if_c<
- // OK to evaluate is_callable<R> here.
- // R should be compete by now.
                         is_callable<R>::value
- , call_ // "R" is a function to call
- , make_ // "R" is an object to construct
+ , call<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is a function to call
+ , make<R(BOOST_PP_ENUM_PARAMS(N, A))> // "R" is an object to construct
>::type
                 which;
 


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