[Boost-bugs] [Boost C++ Libraries] #12928: x3 cannot synthesize attribute of type boost::iterator_range in a sequence parser

Subject: [Boost-bugs] [Boost C++ Libraries] #12928: x3 cannot synthesize attribute of type boost::iterator_range in a sequence parser
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-24 10:36:08


#12928: x3 cannot synthesize attribute of type boost::iterator_range in a sequence
parser
-----------------------------------------------------+---------------------
 Reporter: wanghan02@… | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: x3, attribute, iterator_range, sequence |
-----------------------------------------------------+---------------------
 In a simple parser test [http://coliru.stacked-
 crooked.com/a/5b3bde9736c9fc43]


 {{{
     std::string str("x123x");
     boost::iterator_range<boost::range_iterator<decltype(str)>::type>
 attr;
     if( x3::parse( boost::begin(str), boost::end(str), x3::lit('x') >>
 x3::raw[+x3::digit] >> x3::lit('x'), attr ) ) {
         std::cout<<"Match! attr = "<<attr<<std::endl;
     } else {
         std::cout<<"Not match!"<<std::endl;
     }
 }}}


 '''x3::lit('x') >> x3::raw[+x3::digit] >> x3::lit('x')''' is supposed to
 synthesize an attribute of type boost::iterator_range<Iterator>. But it
 cannot compile. If we remove either of the two '''x3::lit('x')''', it
 compiles.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12928>
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-03-24 10:40:49 UTC