Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2008-06-30 11:49:28


Author: eric_niebler
Date: 2008-06-30 11:49:27 EDT (Mon, 30 Jun 2008)
New Revision: 46919
URL: http://svn.boost.org/trac/boost/changeset/46919

Log:
portability fixes
Text files modified:
   branches/release/boost/xpressive/detail/static/transforms/as_action.hpp | 7 +++++++
   branches/release/libs/xpressive/test/misc2.cpp | 9 +++++----
   2 files changed, 12 insertions(+), 4 deletions(-)

Modified: branches/release/boost/xpressive/detail/static/transforms/as_action.hpp
==============================================================================
--- branches/release/boost/xpressive/detail/static/transforms/as_action.hpp (original)
+++ branches/release/boost/xpressive/detail/static/transforms/as_action.hpp 2008-06-30 11:49:27 EDT (Mon, 30 Jun 2008)
@@ -39,6 +39,13 @@
         typedef Matcher matcher_type;
     };
 
+ template<typename Nbr, typename Matcher>
+ struct read_attr<Nbr, Matcher &>
+ {
+ typedef Nbr nbr_type;
+ typedef Matcher matcher_type;
+ };
+
 }}}
 
 namespace boost { namespace xpressive { namespace grammar_detail

Modified: branches/release/libs/xpressive/test/misc2.cpp
==============================================================================
--- branches/release/libs/xpressive/test/misc2.cpp (original)
+++ branches/release/libs/xpressive/test/misc2.cpp 2008-06-30 11:49:27 EDT (Mon, 30 Jun 2008)
@@ -11,7 +11,8 @@
 #include <boost/xpressive/regex_actions.hpp>
 #include <boost/test/unit_test.hpp>
 
-using namespace boost::xpressive;
+namespace xpr = boost::xpressive;
+using namespace xpr;
 
 ///////////////////////////////////////////////////////////////////////////////
 //
@@ -34,7 +35,7 @@
     std::string str("foo");
 
     sregex_compiler compiler;
- compiler["rx0"] = (s1="foo")[ ref(result) = s1 ];
+ compiler["rx0"] = (s1="foo")[ xpr::ref(result) = s1 ];
     sregex rx = compiler.compile("(?>(?$rx0))");
 
     bool ok = regex_match(str, rx);
@@ -49,7 +50,7 @@
     std::string result;
     std::string str("foo");
 
- sregex rx0 = (s1="foo")[ ref(result) = s1 ];
+ sregex rx0 = (s1="foo")[ xpr::ref(result) = s1 ];
     sregex rx = keep(rx0);
 
     bool ok = regex_match(str, rx);
@@ -69,7 +70,7 @@
     std::string expected("\"this\" has the value \"that\"");
     sregex rx = "$(" >> (s1= +~as_xpr(')')) >> ')';
 
- output = regex_replace(input, rx, ref(replacements)[s1]);
+ output = regex_replace(input, rx, xpr::ref(replacements)[s1]);
     BOOST_CHECK_EQUAL(output, expected);
 }
 


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