Boost C++ Libraries: Ticket #12932: "Char >> (Literal | Sequence)" unpacking https://svn.boost.org/trac10/ticket/12932 <p> This is the simplest I was able to reduce this to. What is going on here? </p> <p> Requirements: -Boost 1.62 or 1.63 /w spirit v2 -C++03/C++11/C++14 </p> <p> Steps: g++ test.cpp &amp;&amp; ./a.out </p> <p> Expected: Success: "x" "a" "b" "c" </p> <p> Result: Success: "x" "a" "" "" </p> <pre class="wiki">#include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;cstdlib&gt; #include &lt;iostream&gt; #include &lt;string&gt; int main(int argc, char * argv[]) { namespace qi = boost::spirit::qi; const std::string input("xabc"); char x = 0; char a = 0; char b = 0; char c = 0; const int result = qi::parse( input.begin(), input.end(), qi::char_ &gt;&gt; (qi::lit("Z") | (qi::char_ &gt;&gt; qi::char_ &gt;&gt; qi::char_)), x, a, b, c ); std::cout &lt;&lt; (result ? "Success" : "Failure") &lt;&lt; ": " &lt;&lt; '"' &lt;&lt; x &lt;&lt; "\" \"" &lt;&lt; a &lt;&lt; "\" \"" &lt;&lt; b &lt;&lt; "\" \"" &lt;&lt; c &lt;&lt; '"' &lt;&lt; std::endl; return result ? EXIT_SUCCESS : EXIT_FAILURE; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12932 Trac 1.4.3 anonymous Fri, 24 Mar 2017 22:17:22 GMT <link>https://svn.boost.org/trac10/ticket/12932#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12932#comment:1</guid> <description> <p> Similarly, substituting this rule seems to generate the same result: </p> <pre class="wiki"> qi::char_ &gt;&gt; ((qi::char_ &gt;&gt; qi::char_ &gt;&gt; qi::char_) - "Z"), </pre><p> Am I missing something trivial here? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Amine</dc:creator> <pubDate>Mon, 01 May 2017 10:30:36 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12932#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12932#comment:2</guid> <description> <p> The attribute of the parser <code> (qi::char_ &gt;&gt; qi::char_ &gt;&gt; qi::char_) </code> is <code> boost::fusion::vector3&lt;char, char, char&gt; </code> so you should write your code this way : </p> <pre class="wiki">#include &lt;boost/spirit/include/qi.hpp&gt; #include &lt;cstdlib&gt; #include &lt;iostream&gt; #include &lt;string&gt; int main(int argc, char * argv[]) { namespace qi = boost::spirit::qi; namespace fusion = boost::fusion; const std::string input("xabc"); char x = 0; fusion::vector3&lt;char, char, char&gt; v; const int result = qi::parse( input.begin(), input.end(), qi::char_ &gt;&gt; (qi::lit("Z") | (qi::char_ &gt;&gt; qi::char_ &gt;&gt; qi::char_)), x, v ); std::cout &lt;&lt; (result ? "Success" : "Failure") &lt;&lt; ": " &lt;&lt; '"' &lt;&lt; x &lt;&lt; "\" \"" &lt;&lt; fusion::at_c&lt;0&gt;(v) &lt;&lt; "\" \"" &lt;&lt; fusion::at_c&lt;1&gt;(v) &lt;&lt; "\" \"" &lt;&lt; fusion::at_c&lt;2&gt;(v) &lt;&lt; '"' &lt;&lt; std::endl; return result ? EXIT_SUCCESS : EXIT_FAILURE; } </pre> </description> <category>Ticket</category> </item> <item> <author>Nikita Kniazev <nok.raven@…></author> <pubDate>Thu, 14 Dec 2017 17:14:20 GMT</pubDate> <title>keywords, type, summary changed https://svn.boost.org/trac10/ticket/12932#comment:3 https://svn.boost.org/trac10/ticket/12932#comment:3 <ul> <li><strong>keywords</strong> unpacking added; or sequence removed </li> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>summary</strong> <span class="trac-field-old">Boost Spirit 1.63 "Char &gt;&gt; (Literal | Sequence)" Bug</span> → <span class="trac-field-new">"Char &gt;&gt; (Literal | Sequence)" unpacking</span> </li> </ul> <p> Amine is right here, though it is actually <code>optional&lt;vector3&lt;char, char, char&gt;&gt;</code>. I consider this not a bug, but feature request. </p> Ticket