Boost C++ Libraries: Ticket #8579: qi::as/qi::attr_cast<container_type> cannot be combined with some other parsers https://svn.boost.org/trac10/ticket/8579 <p> The following code should compile, but it doesn't. If you remove "&gt;&gt; qi::eoi" part from the rule, it compiles. There may be other parsers in place of qi::eoi which don't expose any attribute (qi::lit, qi::eps) - the code won't compile either. qi::as&lt;vector_type&gt; is redundant in this particular example, but it can do the work in a real program. </p> <pre class="wiki">#include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;boost/spirit/include/qi_match.hpp&gt; #include &lt;iostream&gt; #include &lt;sstream&gt; #include &lt;vector&gt; namespace qi = boost::spirit::qi; int main() { typedef std::vector&lt;int&gt; vector_type; vector_type vector; std::istringstream is("11 22 33"); is &gt;&gt; std::noskipws &gt;&gt; qi::match(qi::as&lt;vector_type&gt;()[qi::int_ % ' '] &gt;&gt; qi::eoi, vector); // is &gt;&gt; std::noskipws &gt;&gt; qi::match(qi::attr_cast&lt;vector_type&gt;(qi::int_ % ' ') &gt;&gt; qi::eoi, vector); assert(is); for (auto value : vector) std::cout &lt;&lt; value &lt;&lt; ' '; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8579 Trac 1.4.3 K-ballo <kaballo86@…> Thu, 16 May 2013 05:17:59 GMT attachment set https://svn.boost.org/trac10/ticket/8579 https://svn.boost.org/trac10/ticket/8579 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">spirit.qi.handles_container.patch</span> </li> </ul> <p> Tentative fix patch </p> Ticket