Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61076 - trunk/boost/proto
From: eric_at_[hidden]
Date: 2010-04-05 15:15:49


Author: eric_niebler
Date: 2010-04-05 15:15:49 EDT (Mon, 05 Apr 2010)
New Revision: 61076
URL: http://svn.boost.org/trac/boost/changeset/61076

Log:
code clean-up
Text files modified:
   trunk/boost/proto/extends.hpp | 104 +++++++++------------------------------
   1 files changed, 24 insertions(+), 80 deletions(-)

Modified: trunk/boost/proto/extends.hpp
==============================================================================
--- trunk/boost/proto/extends.hpp (original)
+++ trunk/boost/proto/extends.hpp 2010-04-05 15:15:49 EDT (Mon, 05 Apr 2010)
@@ -245,62 +245,32 @@
 
         /// INTERNAL ONLY
         ///
- #define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(Const) \
+ #define BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
         typename boost::result_of< \
             proto_domain( \
                 boost::proto::expr< \
                     boost::proto::tag::assign \
                   , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A, proto_domain>::type \
+ proto_derived_expr ThisConst() & \
+ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \
> \
                   , 2 \
> \
             ) \
>::type const \
- operator =(A &a) Const() \
+ operator =(A ThatConst() &a) ThisConst() \
         { \
             typedef boost::proto::expr< \
                 boost::proto::tag::assign \
               , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A, proto_domain>::type \
+ proto_derived_expr ThisConst() & \
+ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \
> \
               , 2 \
> that_type; \
             that_type that = { \
- *static_cast<proto_derived_expr Const() *>(this) \
- , boost::proto::as_child<proto_domain>(a) \
- }; \
- return proto_domain()(that); \
- } \
- \
- template<typename A> \
- typename boost::result_of< \
- proto_domain( \
- boost::proto::expr< \
- boost::proto::tag::assign \
- , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
- > \
- , 2 \
- > \
- ) \
- >::type const \
- operator =(A const &a) Const() \
- { \
- typedef boost::proto::expr< \
- boost::proto::tag::assign \
- , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
- > \
- , 2 \
- > that_type; \
- that_type that = { \
- *static_cast<proto_derived_expr Const() *>(this) \
+ *static_cast<proto_derived_expr ThisConst() *>(this) \
               , boost::proto::as_child<proto_domain>(a) \
             }; \
             return proto_domain()(that); \
@@ -308,16 +278,18 @@
         /**/
 
     #define BOOST_PROTO_EXTENDS_ASSIGN_CONST_() \
- BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST) \
+ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST, BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST, BOOST_PROTO_CONST) \
         /**/
 
     #define BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST_() \
- BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY, BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY, BOOST_PROTO_CONST) \
         /**/
 
     #define BOOST_PROTO_EXTENDS_ASSIGN_() \
- BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PP_EMPTY) \
- BOOST_PROTO_EXTENDS_ASSIGN_IMPL_(BOOST_PROTO_CONST) \
+ BOOST_PROTO_EXTENDS_ASSIGN_CONST_() \
+ BOOST_PROTO_EXTENDS_ASSIGN_NON_CONST_() \
         /**/
 
     #define BOOST_PROTO_EXTENDS_ASSIGN_CONST() \
@@ -337,62 +309,32 @@
 
         /// INTERNAL ONLY
         ///
- #define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(Const) \
- template<typename A> \
- typename boost::result_of< \
- proto_domain( \
- boost::proto::expr< \
- boost::proto::tag::subscript \
- , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A, proto_domain>::type \
- > \
- , 2 \
- > \
- ) \
- >::type const \
- operator [](A &a) Const() \
- { \
- typedef boost::proto::expr< \
- boost::proto::tag::subscript \
- , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A, proto_domain>::type \
- > \
- , 2 \
- > that_type; \
- that_type that = { \
- *static_cast<proto_derived_expr Const() *>(this) \
- , boost::proto::as_child<proto_domain>(a) \
- }; \
- return proto_domain()(that); \
- } \
- \
+ #define BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(ThisConst, ThatConst) \
         template<typename A> \
         typename boost::result_of< \
             proto_domain( \
                 boost::proto::expr< \
                     boost::proto::tag::subscript \
                   , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
+ proto_derived_expr ThisConst() & \
+ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \
> \
                   , 2 \
> \
             ) \
>::type const \
- operator [](A const &a) Const() \
+ operator [](A ThatConst() &a) ThisConst() \
         { \
             typedef boost::proto::expr< \
                 boost::proto::tag::subscript \
               , boost::proto::list2< \
- proto_derived_expr Const() & \
- , typename boost::proto::result_of::as_child<A const, proto_domain>::type \
+ proto_derived_expr ThisConst() & \
+ , typename boost::proto::result_of::as_child<A ThatConst(), proto_domain>::type \
> \
               , 2 \
> that_type; \
             that_type that = { \
- *static_cast<proto_derived_expr Const() *>(this) \
+ *static_cast<proto_derived_expr ThisConst() *>(this) \
               , boost::proto::as_child<proto_domain>(a) \
             }; \
             return proto_domain()(that); \
@@ -400,11 +342,13 @@
         /**/
 
     #define BOOST_PROTO_EXTENDS_SUBSCRIPT_CONST() \
- BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PROTO_CONST) \
+ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PROTO_CONST, BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PROTO_CONST, BOOST_PROTO_CONST) \
         /**/
 
     #define BOOST_PROTO_EXTENDS_SUBSCRIPT_NON_CONST() \
- BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PP_EMPTY, BOOST_PP_EMPTY) \
+ BOOST_PROTO_EXTENDS_SUBSCRIPT_IMPL_(BOOST_PP_EMPTY, BOOST_PROTO_CONST) \
         /**/
 
     #define BOOST_PROTO_EXTENDS_SUBSCRIPT() \


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