Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-05-13 12:03:22


Author: eric_niebler
Date: 2008-05-13 12:03:21 EDT (Tue, 13 May 2008)
New Revision: 45330
URL: http://svn.boost.org/trac/boost/changeset/45330

Log:
flesh out op::member. pass-through just works.
Text files modified:
   branches/proto/v4/boost/proto/extends.hpp | 2 ++
   branches/proto/v4/boost/proto/traits.hpp | 35 +++++++++++++++++++++++++++++++----
   2 files changed, 33 insertions(+), 4 deletions(-)

Modified: branches/proto/v4/boost/proto/extends.hpp
==============================================================================
--- branches/proto/v4/boost/proto/extends.hpp (original)
+++ branches/proto/v4/boost/proto/extends.hpp 2008-05-13 12:03:21 EDT (Tue, 13 May 2008)
@@ -10,6 +10,7 @@
 #define BOOST_PROTO_EXTENDS_HPP_EAN_11_1_2006
 
 #include <boost/proto/detail/prefix.hpp>
+#include <cstddef> // for offsetof
 #include <boost/preprocessor/tuple/elem.hpp>
 #include <boost/preprocessor/control/if.hpp>
 #include <boost/preprocessor/arithmetic/inc.hpp>
@@ -20,6 +21,7 @@
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
 #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
+#include <boost/utility/addressof.hpp>
 #include <boost/utility/result_of.hpp>
 #include <boost/proto/proto_fwd.hpp>
 #include <boost/proto/traits.hpp>

Modified: branches/proto/v4/boost/proto/traits.hpp
==============================================================================
--- branches/proto/v4/boost/proto/traits.hpp (original)
+++ branches/proto/v4/boost/proto/traits.hpp 2008-05-13 12:03:21 EDT (Tue, 13 May 2008)
@@ -1570,15 +1570,27 @@
                 typedef U proto_child1;
             };
 
- /// \brief A grammar element for matching virtual data members.
- ///
+ /// \brief A metafunction for generating virtual data member expression
+ /// types, a grammar element for matching member expressions, and a
+ /// PrimitiveTransform that dispatches to the <tt>pass_through\<\></tt>
+ /// transform.
             template<typename T, typename U>
- struct member
+ struct member : transform<member<T, U>, empty_base>
             {
                 typedef expr<tag::member, list2<T, U> > type;
                 typedef type proto_base_expr;
 
- // TODO pass-through transform?
+ template<typename Expr, typename State, typename Data>
+ struct impl
+ : pass_through<member>::template impl<Expr, State, Data>
+ {};
+
+ /// INTERNAL ONLY
+ typedef proto::tag::member proto_tag;
+ /// INTERNAL ONLY
+ typedef T proto_child0;
+ /// INTERNAL ONLY
+ typedef U proto_child1;
             };
 
         } // namespace op
@@ -2201,6 +2213,13 @@
                 BOOST_PP_ENUM_PARAMS(N, A)
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
>
+ : transform<
+ function<
+ BOOST_PP_ENUM_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ >
+ , empty_base
+ >
             {
                 typedef proto::expr<proto::tag::function, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
                 typedef type proto_base_expr;
@@ -2235,6 +2254,14 @@
                 BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
                 BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
>
+ : transform<
+ nary_expr<
+ Tag
+ BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
+ BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PP_SUB(BOOST_PROTO_MAX_ARITY, N), void BOOST_PP_INTERCEPT), void
+ >
+ , empty_base
+ >
             {
                 typedef proto::expr<Tag, BOOST_PP_CAT(list, N)<BOOST_PP_ENUM_PARAMS(N, A)> > type;
                 typedef type proto_base_expr;


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