|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2007-12-23 00:09:54
Author: eric_niebler
Date: 2007-12-23 00:09:54 EST (Sun, 23 Dec 2007)
New Revision: 42259
URL: http://svn.boost.org/trac/boost/changeset/42259
Log:
BOOST_PROTO_EXTENDS_FUNCTION() generates nullary operator()
Text files modified:
branches/proto/v3/boost/xpressive/proto/extends.hpp | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
Modified: branches/proto/v3/boost/xpressive/proto/extends.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/extends.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/extends.hpp 2007-12-23 00:09:54 EST (Sun, 23 Dec 2007)
@@ -248,12 +248,29 @@
/// INTERNAL ONLY
///
#define BOOST_PROTO_EXTENDS_FUNCTION_IMPL_8(R, SIZE, PRODUCT) \
- BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(R, SIZE, PRODUCT, 0) \
- BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(R, SIZE, PRODUCT, 1)
+ BOOST_PROTO_EXTENDS_FUNCTION_IMPL_10(R, SIZE, PRODUCT, 0) \
+ BOOST_PROTO_EXTENDS_FUNCTION_IMPL_10(R, SIZE, PRODUCT, 1)
/// INTERNAL ONLY
///
- #define BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(R, SIZE, PRODUCT, Const) \
+ #define BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(Const) \
+ typename boost::proto::result_of::make_expr_ref< \
+ boost::proto::tag::function \
+ , proto_domain \
+ , proto_derived_expr BOOST_PROTO_CONST ## Const & \
+ >::type const \
+ operator ()() BOOST_PROTO_CONST ## Const \
+ { \
+ return boost::proto::result_of::make_expr_ref< \
+ boost::proto::tag::function \
+ , proto_domain \
+ , proto_derived_expr BOOST_PROTO_CONST ## Const & \
+ >::call(*static_cast<proto_derived_expr BOOST_PROTO_CONST ## Const *>(this)); \
+ }
+
+ /// INTERNAL ONLY
+ ///
+ #define BOOST_PROTO_EXTENDS_FUNCTION_IMPL_10(R, SIZE, PRODUCT, Const) \
template<BOOST_PP_ENUM_PARAMS(SIZE, typename A)> \
typename boost::proto::result_of::make_expr_ref< \
boost::proto::tag::function \
@@ -276,6 +293,8 @@
}
#define BOOST_PROTO_EXTENDS_FUNCTION() \
+ BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(0) \
+ BOOST_PROTO_EXTENDS_FUNCTION_IMPL_9(1) \
BOOST_PP_FOR( \
BOOST_PROTO_EXTENDS_FUNCTION_IMPL_1 \
, BOOST_PROTO_EXTENDS_FUNCTION_IMPL_3 \
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