|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2007-10-09 21:46:54
Author: eric_niebler
Date: 2007-10-09 21:46:53 EDT (Tue, 09 Oct 2007)
New Revision: 39870
URL: http://svn.boost.org/trac/boost/changeset/39870
Log:
fix buggy predicate_matcher and stomp more msvc warnings
Text files modified:
trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp | 12 ++++++------
trunk/boost/xpressive/detail/static/placeholders.hpp | 9 +++++++--
2 files changed, 13 insertions(+), 8 deletions(-)
Modified: trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp
==============================================================================
--- trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp (original)
+++ trunk/boost/xpressive/detail/core/matcher/predicate_matcher.hpp 2007-10-09 21:46:53 EDT (Tue, 09 Oct 2007)
@@ -29,9 +29,9 @@
template<typename BidiIter>
struct predicate_context
{
- explicit predicate_context(int sub, match_results<BidiIter> const &what)
+ explicit predicate_context(int sub, sub_match_impl<BidiIter> const *sub_matches)
: sub_(sub)
- , what_(what)
+ , sub_matches_(sub_matches)
{}
// eval_terminal
@@ -56,7 +56,7 @@
typedef sub_match<BidiIter> const &result_type;
result_type operator()(Expr &expr, predicate_context const &ctx) const
{
- return ctx.what_[ctx.sub_];
+ return ctx.sub_matches_[ctx.sub_];
}
};
@@ -66,7 +66,7 @@
typedef sub_match<BidiIter> const &result_type;
result_type operator()(Expr &expr, predicate_context const &ctx) const
{
- return ctx.what_[expr];
+ return ctx.sub_matches_[proto::arg(expr).mark_number_];
}
};
@@ -89,7 +89,7 @@
#endif
int sub_;
- match_results<BidiIter> const &what_;
+ sub_match_impl<BidiIter> const *sub_matches_;
};
///////////////////////////////////////////////////////////////////////////////
@@ -126,7 +126,7 @@
template<typename BidiIter, typename Next>
bool match_(match_state<BidiIter> &state, Next const &next, mpl::true_) const
{
- predicate_context<BidiIter> ctx(this->sub_, *state.context_.results_ptr_);
+ predicate_context<BidiIter> ctx(this->sub_, state.sub_matches_);
return proto::eval(proto::arg(this->predicate_).pred, ctx) && next.match(state);
}
};
Modified: trunk/boost/xpressive/detail/static/placeholders.hpp
==============================================================================
--- trunk/boost/xpressive/detail/static/placeholders.hpp (original)
+++ trunk/boost/xpressive/detail/static/placeholders.hpp 2007-10-09 21:46:53 EDT (Tue, 09 Oct 2007)
@@ -11,6 +11,9 @@
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
+# pragma warning(push)
+# pragma warning(disable:4510) // default constructor could not be generated
+# pragma warning(disable:4610) // can never be instantiated - user defined constructor required
#endif
#include <string>
@@ -29,8 +32,6 @@
BOOST_XPR_QUANT_STYLE(quant_variable_width, unknown_width::value, true)
int mark_number_;
-
- //operator int() const { return this->mark_number_; }
};
///////////////////////////////////////////////////////////////////////////////
@@ -123,4 +124,8 @@
}}} // namespace boost::xpressive::detail
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma warning(pop)
+#endif
+
#endif
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