|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2007-12-09 00:35:52
Author: eric_niebler
Date: 2007-12-09 00:35:52 EST (Sun, 09 Dec 2007)
New Revision: 41918
URL: http://svn.boost.org/trac/boost/changeset/41918
Log:
fix nasty bug with object lifetime management
Text files modified:
branches/proto/v3/boost/xpressive/proto/transform/arg.hpp | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
Modified: branches/proto/v3/boost/xpressive/proto/transform/arg.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/arg.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/arg.hpp 2007-12-09 00:35:52 EST (Sun, 09 Dec 2007)
@@ -44,7 +44,13 @@
template<typename This, typename Expr, typename State, typename Visitor>
struct result<This(Expr, State, Visitor)>
{
- typedef CVREF(UNREF(Expr)) type;
+ typedef Expr type;
+ };
+
+ template<typename This, typename Expr, typename State, typename Visitor>
+ struct result<This(Expr &, State, Visitor)>
+ {
+ typedef Expr const &type;
};
template<typename Expr, typename State, typename Visitor>
@@ -66,6 +72,12 @@
typedef State type;
};
+ template<typename This, typename Expr, typename State, typename Visitor>
+ struct result<This(Expr, State &, Visitor)>
+ {
+ typedef State const &type;
+ };
+
template<typename Expr, typename State, typename Visitor>
State const &
operator()(Expr const &, State const &state, Visitor &) const
@@ -101,7 +113,12 @@
template<typename This, typename Expr, typename State, typename Visitor>
struct result<This(Expr, State, Visitor)>
- : proto::result_of::arg_c<CVREF(UNREF(Expr)), I>
+ : proto::result_of::value_at_c<Expr, I>
+ {};
+
+ template<typename This, typename Expr, typename State, typename Visitor>
+ struct result<This(Expr &, State, Visitor)>
+ : proto::result_of::arg_c<Expr const &, I>
{};
template<typename Expr, typename State, typename Visitor>
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