Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot phoenix::bind qi::_val with boost 1.53 (regression ?)
    primarykey
    data
    text
    <p>The code below, using boost::spirit, used to work with boost 1.44 and boost 1.49:</p> <pre><code>qi::string("a_token") [ boost::phoenix::bind(&amp;node_t::some_func, *qi::_val, true) ] </code></pre> <p>I updated boost to version 1.53, but now this code does not compile anymore. g++ complains about</p> <pre><code>error: pointer to member type 'void (node_t::)(bool)' incompatible with object type 'boost::error_cant_deduce_type' </code></pre> <p>I can't figure out how to fix it. The following code compiles :</p> <pre><code>qi::string("a_token") [ boost::phoenix::bind(&amp;node_t::some_func, (node_t*)0, true) ] </code></pre> <p>So I guess the problem is with qi::val_... Did the API of boost::spirit changed or am I missing an include file ?</p> <p>I'm using g++4.7, with --std=c++0x.</p> <p>Here I tried a small test case to reproduce the problem. The error message is not the same (but it's still big !), but once again the dereference operator seems to be the problem.</p> <pre><code>#include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;boost/spirit/include/phoenix_operator.hpp&gt; #include &lt;boost/spirit/include/phoenix_bind.hpp&gt; #include &lt;boost/shared_ptr.hpp&gt; struct node_t { void foo(bool){} }; int main() { namespace qi = boost::spirit::qi; boost::spirit::qi::rule &lt; std::string::const_iterator, boost::shared_ptr&lt;node_t&gt;(), boost::spirit::ascii::space_type &gt; rule; rule = qi::string("true") [boost::phoenix::bind(&amp;node_t::foo, *qi::_val, true)]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload