title: Problems with boost::phoenix::bind and boost::phoenix::actors in a semantic action for boost::spirit::qi
body: <p>I think I am having an issue understanding how my <code>boost::spirit::qi</code> parser is supposed to be written.  I simply want to pass matched substrings to functions via semantic actions.  In an attempt to roughly emulate <a href="http://www.boost.org/doc/libs/1_46_1/libs/spirit/doc/html/spirit/qi/tutorials/semantic_actions.html" rel="nofollow">this boost tutorial</a>, I have come up with the following code:</p>
  
  <pre><code>template&lt;class Iterator&gt; 
  struct _Calculator : public qi::grammar&lt;Iterator&gt; {                                                                                               
  
      qi::rule&lt;Iterator&gt; number, result; //and a whole bunch of other ones too                                                            
  
      qi::rule&lt;Iterator,std::string()&gt; variable;                                                                                      
  
      Code&amp; code;                                                                                                    
      Variables&amp; variables;                                                                                                          
  
      _Calculator(Code&amp; code_, Variables&amp; variables_)
        : _Calculator::base_type(result),                                                                                                           
          code(code_),
          variables(variables_)                                                                                                                     
     {  
            number =
                  lexeme[(qi::char_("1-9") &gt;&gt; +qi::char_("0-9"))[boost::phoenix::bind(&amp;fPushIntCV, qi::_1, boost::ref(code), boost::ref(variables))]]
                | lexeme[("0x" &gt;&gt; +qi::char_("0-9a-fA-F"))      [boost::phoenix::bind(&amp;fPushIntCV, qi::_1, boost::ref(code), boost::ref(variables))]]
                | lexeme[("0b" &gt;&gt; +qi::char_("0-1"))            [boost::phoenix::bind(&amp;fPushIntCV, qi::_1, boost::ref(code), boost::ref(variables))]]
                | lexeme[("0" &gt;&gt;  +qi::char_("0-7"))            [boost::phoenix::bind(&amp;fPushIntCV, qi::_1, boost::ref(code), boost::ref(variables))]]
            //some other junk
      }
  };
  typedef _Calculator&lt;std::string::const_iterator&gt; Calculator;
  </code></pre>
  
  <p>When the declaration of <code>fPushIntCV</code> looks like this:</p>
  
  <pre><code>void fPushIntCV (vector&lt;char&gt; my_str, Code&amp; c, Variables&amp; v);
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><code>function_ptr.hpp:89: error: conversion from 'char' to non-scalar type 'std::vector&lt;char, std::allocator&lt;char&gt; &gt;' requested</code></p>
  
  <p>When I  change the declaration of <code>fPushIntCV</code> to look like this:</p>
  
  <pre><code>void fPushIntCV (char my_str, Code&amp; c, Variables&amp; v);
  </code></pre>
  
  <p>I get this error:</p>
  
  <p><code>function_ptr.hpp:89: error: cannot convert 'std::vector&lt;char, std::allocator&lt;char&gt; &gt;' to 'char' in argument passing</code></p>
  
  <p>I figured that the attribute of <code>qi::_1</code> is changing, but I get unresolved references if I include both function prototypes and now pass <code>boost::phoenix::bind</code> some ambiguous overloaded function pointer:</p>
  
  <p><code>error: no matching function for call to 'bind(&lt;unresolved overloaded function type&gt;, const boost::spirit::_1_type&amp;, ...</code> (my <code>...</code> for trailing unrelated garbage)</p>
  
  <p>I know this is probably a really simple error and a really simple fix, but I'm having a helluva time understanding the spell to make the boost magic do its thing.  What is the function prototype that this semantic action is expecting?</p>