[Boost-bugs] [Boost C++ Libraries] #12870: bugs?: xpressive: xp::skip(xp::_s) does not work

Subject: [Boost-bugs] [Boost C++ Libraries] #12870: bugs?: xpressive: xp::skip(xp::_s) does not work
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-26 04:05:24


#12870: bugs?: xpressive: xp::skip(xp::_s) does not work
---------------------------------+--------------------------
 Reporter: shinichiro.hamada@… | Owner: eric_niebler
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: xpressive
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
---------------------------------+--------------------------
 If you execute the following code, "[ 4]" will be output,
 but right output is supposed to be "[4]".


 === Source Code ===

 {{{
 #include <iostream>
 #include <boost/xpressive/xpressive.hpp>

 using namespace std;
 namespace xp = boost::xpressive;

 int main()
 {
         xp::sregex rule2 = xp::skip(xp::_s)('(' >> (xp::s1= *xp::_d) >>
 ')');
         xp::sregex rule1 = xp::skip(xp::_s)(rule2);
         xp::smatch match1;
         if (!xp::regex_match(string("( 4 )"), match1, rule1)) {
                 cout << "syntax error" << endl;
         } else {
                 auto&& match2 = *match1.nested_results().begin();
                 string text = match2[1];
                 cout << "[" << text << "]" << endl;
         }
         return 0;
 }
 }}}


 === Compilation Environment ===

 * [OS] centos 6.8
 * [Compiler] g++ v4.9.3
 * [Command Line] g++ -std=c++11 a.cpp
 * [Libs] boost-1.63.0


 Thanks for Boost.Xpressive!

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12870>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-26 04:09:21 UTC