title: boost::qi::parse seems to cause compilation errors
body: <p>I'm trying to write a parser using Boost::Spirit, and I have the parser written and compiling. The problem is, when I try to compile the parsing function, the compiler throws out a bunch of template errors. Here's the Qi grammar:</p>
  
  <pre><code>template&lt;typename Iterator&gt;
  struct etf_parser : qi::grammar&lt;Iterator, std::map&lt;std::string, etfnode&gt;(), ascii::space_type&gt; {
      etf_parser() : etf_parser::base_type(start) {
              using qi::int_;
              using qi::lit;
              using qi::double_;
              using qi::bool_;
              using qi::lexeme;
              using ascii::char_;
  
              quoted_string %= lexeme['"' &gt;&gt; +(char_ - '"') &gt;&gt; '"'];
  
              dataVal %= (quoted_string | double_ | int_ | bool_ | listObj | pairObj | mapObj);
  
              pairObj %= ('&lt;' &gt;&gt; dataVal &gt;&gt; ',' &gt;&gt; dataVal &gt;&gt; '&gt;');
  
              listObj %= '{' &gt;&gt; dataVal % ',' &gt;&gt; '}';
  
              mapKey %= +qi::char_("a-zA-Z_-0-9.");
              mapPair %= mapKey &gt;&gt; lit('=') &gt;&gt; dataVal;
              mapObj %= '(' &gt;&gt; mapPair % ',' &gt;&gt; ')';
              start %= mapPair &gt;&gt; ';';
      }
  
      qi::rule&lt;Iterator, std::string(), ascii::space_type&gt; quoted_string;
  
      // Data value parsers
      qi::rule&lt;Iterator, etfnode(), ascii::space_type&gt; dataVal;
      qi::rule&lt;Iterator, std::vector&lt;etfnode&gt;(), ascii::space_type&gt; listObj;
      qi::rule&lt;Iterator, std::pair&lt;etfnode, etfnode&gt;(), ascii::space_type&gt; pairObj;
      qi::rule&lt;Iterator, std::map&lt;std::string, etfnode&gt;(), ascii::space_type&gt; mapObj;
  
      qi::rule&lt;Iterator, std::pair&lt;std::string, etfnode&gt;(), ascii::space_type&gt; mapPair;
      qi::rule&lt;Iterator, std::string(), ascii::space_type&gt; mapKey;
  
      qi::rule&lt;Iterator, std::map&lt;std::string, etfnode&gt;(), ascii::space_type&gt; start;
  };
  </code></pre>
  
  <p>And here's the parsing function. When I comment out the qi::parse call, the code compiles fine:</p>
  
  <pre><code>ETFDocument::ETFDocument(std::string content) {
      etf_parser&lt;std::string::const_iterator&gt; parser;
      std::map&lt;std::string, rwnode&gt; results;
      std::string::const_iterator begin = content.begin();
      std::string::const_iterator end = content.end();
      bool result = qi::parse(begin, end, parser, results);
      if(result) printf("Parsing succeeded\n"); else printf("Parsing failed\n");
  
      m_root = etfnode(results);
  }
  </code></pre>
  
  <p>The compiler spits out the following error when I try to compile:</p>
  
  <pre><code>In file included from /usr/include/boost/spirit/home/qi/nonterminal.hpp:14:0,
               from /usr/include/boost/spirit/home/qi.hpp:20,
               from /usr/include/boost/spirit/include/qi.hpp:16,
               from libmcg/etf.cpp:8:
  /usr/include/boost/spirit/home/qi/nonterminal/rule.hpp: In instantiation of ‘bool boost::spirit::qi::rule&lt;Iterator, T1, T2, T3, T4&gt;::parse(Iterator&amp;, const Iterator&amp;, Context&amp;, const Skipper&amp;, Attribute&amp;) const [with Context = boost::spirit::context&lt;boost::fusion::cons&lt;std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;&amp;, boost::fusion::nil&gt;, boost::spirit::locals&lt;&gt; &gt;; Skipper = boost::spirit::unused_type; Attribute = std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;; Iterator = __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;; T1 = std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;(); T2 = boost::proto::exprns_::expr&lt;boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;, 0l&gt;; T3 = boost::spirit::unused_type; T4 = boost::spirit::unused_type]’:
  /usr/include/boost/spirit/home/qi/reference.hpp:43:71:   required from ‘bool boost::spirit::qi::reference&lt;Subject&gt;::parse(Iterator&amp;, const Iterator&amp;, Context&amp;, const Skipper&amp;, Attribute&amp;) const [with Iterator = __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;; Context = boost::spirit::context&lt;boost::fusion::cons&lt;std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;&amp;, boost::fusion::nil&gt;, boost::spirit::locals&lt;&gt; &gt;; Skipper = boost::spirit::unused_type; Attribute = std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;; Subject = const boost::spirit::qi::rule&lt;__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;(), boost::proto::exprns_::expr&lt;boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;, 0l&gt;, boost::spirit::unused_type, boost::spirit::unused_type&gt;]’
  /usr/include/boost/spirit/home/qi/parse.hpp:86:82:   required from ‘bool boost::spirit::qi::parse(Iterator&amp;, Iterator, const Expr&amp;, Attr&amp;) [with Iterator = __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;; Expr = etf_parser&lt;__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt; &gt;; Attr = std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;]’
  libmcg/etf.cpp:113:53:   required from here
  /usr/include/boost/spirit/home/qi/nonterminal/rule.hpp:303:17: error: no match for call to ‘(const function_type {aka const boost::function&lt;bool(__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;, const __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;, boost::spirit::context&lt;boost::fusion::cons&lt;std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;&amp;, boost::fusion::nil&gt;, boost::fusion::vector0&lt;&gt; &gt;&amp;, const boost::spirit::qi::char_class&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;&amp;)&gt;}) (__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;, const __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;, boost::spirit::qi::rule&lt;__gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;, std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;(), boost::proto::exprns_::expr&lt;boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;, 0l&gt;, boost::spirit::unused_type, boost::spirit::unused_type&gt;::context_type&amp;, const boost::spirit::unused_type&amp;)’
  In file included from /usr/include/boost/function/detail/maybe_include.hpp:33:0,
               from /usr/include/boost/function/detail/function_iterate.hpp:14,
               from /usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:67,
               from /usr/include/boost/function.hpp:64,
               from /usr/include/boost/spirit/home/qi/nonterminal/rule.hpp:16,
               from /usr/include/boost/spirit/home/qi/nonterminal.hpp:14,
               from /usr/include/boost/spirit/home/qi.hpp:20,
               from /usr/include/boost/spirit/include/qi.hpp:16,
               from libmcg/etf.cpp:8:
  /usr/include/boost/function/function_template.hpp:1021:7: note: candidate is:
  /usr/include/boost/function/function_template.hpp:754:17: note: boost::function4&lt;R, T1, T2, T3, T4&gt;::result_type boost::function4&lt;R, T1, T2, T3, T4&gt;::operator()(T0, T1, T2, T3) const [with R = bool; T0 = __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;; T1 = const __gnu_cxx::__normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;&amp;; T2 = boost::spirit::context&lt;boost::fusion::cons&lt;std::map&lt;std::basic_string&lt;char&gt;, boost::recursive_wrapper&lt;ETFDocument::etfnode&gt; &gt;&amp;, boost::fusion::nil&gt;, boost::fusion::vector0&lt;&gt; &gt;&amp;; T3 = const boost::spirit::qi::char_class&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;&amp;; boost::function4&lt;R, T1, T2, T3, T4&gt;::result_type = bool]
  /usr/include/boost/function/function_template.hpp:754:17: note:   no known conversion for argument 4 from ‘const boost::spirit::unused_type’ to ‘const boost::spirit::qi::char_class&lt;boost::spirit::tag::char_code&lt;boost::spirit::tag::space, boost::spirit::char_encoding::ascii&gt; &gt;&amp;’
  </code></pre>
  
  <p>As far as I can tell, it's looking for a Skipper, but getting boost::spirit::unused_type instead. I'm not sure why this would happen, since I specified a Skipper in my parser definition. I'm using boost v1.49.0 on gcc 4.7.1.</p>
  
  <p><strong>EDIT</strong>: Here's the definition for etfnode. There's a typedef at the beginning of the cpp file (containing the other code fragments) that aliases "etfnode" to "rwnode".</p>
  
  <pre><code>enum DataType {
      DT_INT,
      DT_STRING,
      DT_FLOAT,
      DT_BOOL,
      DT_LIST,
      DT_PAIR,
      DT_MAP
  };
  
  struct etfnode;
  typedef boost::recursive_wrapper&lt;etfnode&gt; rwnode;
  typedef boost::variant&lt;
          int,
          std::string,
          double,
          bool,
          std::vector&lt;rwnode&gt;,
          std::pair&lt;rwnode, rwnode&gt;,
          std::map&lt;std::string, rwnode&gt; &gt; etfvalue;
  
  struct etfnode {
      DataType type;
      etfvalue value;
  
      etfnode(const std::string&amp; s);
      etfnode(const int i);
      etfnode(const double d);
      etfnode(const bool b);
      etfnode(const std::vector&lt;rwnode&gt;&amp; n);
      etfnode(const std::pair&lt;rwnode, rwnode&gt;&amp; p);
      etfnode(const std::map&lt;std::string, rwnode&gt;&amp; p);
      etfnode();
  };
  </code></pre>
  
  <p>And a test string:</p>
  
  <pre><code>foo = 6;
  bar = &lt;"bar", 16.5&gt;;
  baz = {
      (
          foobar = "foo",
          bar = 12
      ),
      "foobar"
  };
  </code></pre>