Re: [Boost-bugs] [Boost C++ Libraries] #6043: Spirit insists that user types are adapted to Fusion

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6043: Spirit insists that user types are adapted to Fusion
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-20 16:44:39


#6043: Spirit insists that user types are adapted to Fusion
-------------------------------+--------------------------------------------
  Reporter: vladimir_prus | Owner:
      Type: Patches | Status: new
 Milestone: To Be Determined | Component: None
   Version: Boost 1.47.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by vladimir_prus):

 On IRC, Thomas produced somewhat easier example. Code the does not work:
 {{{
 #include <boost/spirit/home/qi.hpp>
 #include <boost/spirit/home/phoenix.hpp>

 namespace fusion = boost::fusion;
 namespace qi = boost::spirit::qi;
 namespace phoenix = boost::phoenix;

 struct foo
 {
     foo(fusion::vector<int, double>) {}
 };

 int main()
 {
     typedef std::string::iterator iterator;

     qi::rule<iterator, foo()> foo_rule;

     foo_rule = (qi::int_ >> qi::double_);
 }
 }}}

 Code that does work:

 {{{
 #include <boost/spirit/home/qi.hpp>
 #include <boost/spirit/home/phoenix.hpp>

 namespace fusion = boost::fusion;
 namespace qi = boost::spirit::qi;
 namespace phoenix = boost::phoenix;

 struct foo
 {
     foo() {}
     foo(int, double) {}
     foo(fusion::vector<int, double>) {}
 };

 int main()
 {
     typedef std::string::iterator iterator;

     qi::rule<iterator, fusion::vector<int, double>()> tuple_rule;
     qi::rule<iterator, foo()> foo_rule;

     tuple_rule = (qi::int_ >> qi::double_);
     foo_rule %= tuple_rule.alias();
 }
 }}}

 I frankly don't understand what's going on here, but trying the same
 workaround for me does not work (with Boost trunk, and gcc 4.5.3), while
 Thomas reported this new example (main-with-workaround.cpp) compiles for
 him just fine with 1.47.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6043#comment:1>
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:07 UTC