Subject: [Boost-bugs] [Boost C++ Libraries] #6751: phoenix v3 yields compilation failure in spirit
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-31 02:40:25
#6751: phoenix v3 yields compilation failure in spirit
---------------------------------------------+------------------------------
Reporter: Li He <I.demonstrate@â¦> | Owner: djowel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
Version: Boost 1.49.0 | Severity: Problem
Keywords: spirit, phoenix |
---------------------------------------------+------------------------------
Here is a simple code
{{{
//#define BOOST_SPIRIT_USE_PHOENIX_V3 1
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/spirit/include/phoenix_stl.hpp>
#include <boost/spirit/include/phoenix_statement.hpp>
namespace spirit = boost::spirit ;
namespace qi = boost::spirit::qi ;
namespace ascii = boost::spirit::ascii ;
namespace phoenix = boost::phoenix ;
using qi::int_ ;
using qi::_1 ;
using phoenix::push_back ;
using phoenix::ref ;
using phoenix::if_ ;
int
main (int argc, char* argv[]) {
std::string line ;
std::getline (std::cin, line) ;
std::vector<int> v ;
bool r = spirit::qi::phrase_parse
(line.begin (), line.end (),
int_ [if_(_1 % 2 == 0)[push_back (ref(v), _1)]] % ',',
ascii::space) ;
if (r) {
std::cout << "vector: " ;
std::copy (v.begin(), v.end(),
std::ostream_iterator<int> (std::cout, ", ")) ;
std::cout << std::endl ;
}
return 0 ;
}
}}}
Uncommenting the first line will trigger compilation errors.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6751> 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-16 18:50:09 UTC