Boost C++ Libraries: Ticket #6040: static_cast_ problem in Phoenix v3 https://svn.boost.org/trac10/ticket/6040 <p> Hi, I have the following snippet, which compiles fine with Phoenix v2, but spits a bunch of compile errors with Phoenix v3. This is GCC 4.6.1, Boost 1.47. Thank you. </p> <p> #include &lt;boost/spirit/include/phoenix.hpp&gt; <em>#include &lt;boost/phoenix.hpp&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; #include &lt;sstream&gt; int main() { </em></p> <blockquote> <p> std::vector&lt;unsigned char&gt; data; using boost::phoenix::arg_names::_1; using boost::phoenix::static_cast_; std::ostringstream oss; oss &lt;&lt; std::hex; std::for_each(data.begin(),data.end(), oss &lt;&lt; static_cast_&lt;unsigned int&gt;(_1) ); </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6040 Trac 1.4.3 Dragomir Ivanov <drago.ivanov@…> Thu, 20 Oct 2011 09:53:15 GMT <link>https://svn.boost.org/trac10/ticket/6040#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6040#comment:1</guid> <description> <p> Oh my, the formating is screwed. </p> <pre class="wiki">#include &lt;boost/spirit/include/phoenix.hpp&gt; //#include &lt;boost/phoenix.hpp&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; #include &lt;sstream&gt; int main() { std::vector&lt;unsigned char&gt; data; using boost::phoenix::arg_names::_1; using boost::phoenix::static_cast_; std::ostringstream oss; oss &lt;&lt; std::hex; std::for_each(data.begin(),data.end(), oss &lt;&lt; static_cast_&lt;unsigned int&gt;(_1) ); } </pre><p> Replying to <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6040" title="#6040: Bugs: static_cast_ problem in Phoenix v3 (closed: fixed)">Dragomir Ivanov &lt;drago.ivanov@…&gt;</a>: </p> <blockquote class="citation"> <p> Hi, I have the following snippet, which compiles fine with Phoenix v2, but spits a bunch of compile errors with Phoenix v3. This is GCC 4.6.1, Boost 1.47. Thank you. </p> <p> #include &lt;boost/spirit/include/phoenix.hpp&gt; <em>#include &lt;boost/phoenix.hpp&gt; #include &lt;vector&gt; #include &lt;algorithm&gt; #include &lt;sstream&gt; int main() { </em></p> <blockquote> <p> std::vector&lt;unsigned char&gt; data; using boost::phoenix::arg_names::_1; using boost::phoenix::static_cast_; std::ostringstream oss; oss &lt;&lt; std::hex; std::for_each(data.begin(),data.end(), oss &lt;&lt; static_cast_&lt;unsigned int&gt;(_1) ); </p> </blockquote> <p> } </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Heller</dc:creator> <pubDate>Thu, 20 Oct 2011 13:43:37 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6040#comment:2 https://svn.boost.org/trac10/ticket/6040#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed with <a class="changeset" href="https://svn.boost.org/trac10/changeset/75069" title="[phoenix] - some cosmetic changes - fixing bug #6040 ">[75069]</a>. Thanks for reporting! </p> Ticket