Update of /cvsroot/boost/boost/boost/xpressive/detail/core/matcher
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20055/detail/core/matcher

Modified Files:
        regex_byref_matcher.hpp 
Log Message:
add support for (?R) for self-recursive dynamic regexes

Index: regex_byref_matcher.hpp
===================================================================
RCS file: 
/cvsroot/boost/boost/boost/xpressive/detail/core/matcher/regex_byref_matcher.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- regex_byref_matcher.hpp     17 Apr 2006 19:36:52 -0000      1.3
+++ regex_byref_matcher.hpp     4 Mar 2007 18:07:03 -0000       1.4
@@ -26,7 +26,6 @@
 
 namespace boost { namespace xpressive { namespace detail
 {
-
     
///////////////////////////////////////////////////////////////////////////////
     // regex_byref_matcher
     //
@@ -52,15 +51,24 @@
         template<typename Next>
         bool match(state_type<BidiIter> &state, Next const &next) const
         {
-            // regex_matcher is used for embeding a dynamic regex in a static 
regex. As such,
-            // Next will always point to a static regex.
-            BOOST_MPL_ASSERT((is_static_xpression<Next>));
             BOOST_ASSERT(this->pimpl_ == this->wimpl_.lock().get());
             ensure(this->pimpl_->xpr_, regex_constants::error_badref, "bad 
regex reference");
 
+            return push_context_match(*this->pimpl_, state, this->wrap_(next, 
is_static_xpression<Next>()));
+        }
+
+    private:
+        template<typename Next>
+        static xpression_adaptor<reference_wrapper<Next const>, 
matchable<BidiIter> > wrap_(Next const &next, mpl::true_)
+        {
             // wrap the static xpression in a matchable interface
-            xpression_adaptor<reference_wrapper<Next const>, 
matchable<BidiIter> > adaptor(boost::cref(next));
-            return push_context_match(*this->pimpl_, state, adaptor);
+            return xpression_adaptor<reference_wrapper<Next const>, 
matchable<BidiIter> >(boost::cref(next));
+        }
+
+        template<typename Next>
+        static Next const &wrap_(Next const &next, mpl::false_)
+        {
+            return next;
         }
     };
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to