Boost C++ Libraries: Ticket #5968: phoenix bind and signals2 signal connect fails to compile https://svn.boost.org/trac10/ticket/5968 <p> Using a Phoenix bind in a Signals2 signal fails to compile with errors in either fusion::category_of where actor is missing the category type (in 1.47.0), or in phoenix visit_each (in trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/74198" title="docs.">r74198</a>). </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/phoenix.hpp&gt;</span><span class="cp"></span> <span class="cp">#include</span> <span class="cpf">&lt;boost/signals2.hpp&gt;</span><span class="cp"></span> <span class="k">struct</span> <span class="n">s</span> <span class="p">{</span> <span class="kt">bool</span> <span class="n">f</span><span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">bool</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span> <span class="nb">true</span><span class="p">;</span> <span class="p">}</span> <span class="p">};</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="n">s</span> <span class="n">s_obj</span><span class="p">;</span> <span class="n">boost</span><span class="o">::</span><span class="n">signals2</span><span class="o">::</span><span class="n">signal</span><span class="o">&lt;</span><span class="kt">bool</span> <span class="p">(</span><span class="kt">int</span><span class="p">,</span> <span class="kt">bool</span><span class="p">)</span><span class="o">&gt;</span> <span class="n">sig</span><span class="p">;</span> <span class="n">sig</span><span class="p">.</span><span class="n">connect</span><span class="p">(</span> <span class="n">boost</span><span class="o">::</span><span class="n">phoenix</span><span class="o">::</span><span class="n">bind</span><span class="p">(</span> <span class="o">&amp;</span><span class="n">s</span><span class="o">::</span><span class="n">f</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">s_obj</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">phoenix</span><span class="o">::</span><span class="n">placeholders</span><span class="o">::</span><span class="n">arg1</span><span class="p">,</span> <span class="n">boost</span><span class="o">::</span><span class="n">phoenix</span><span class="o">::</span><span class="n">placeholders</span><span class="o">::</span><span class="n">arg2</span><span class="p">));</span> <span class="p">}</span> </pre></div></div><p> Simplifying the bind to the following expression has the same results: </p> <div class="wiki-code"><div class="code"><pre><span class="p">(</span><span class="n">val</span><span class="p">(</span><span class="o">&amp;</span><span class="n">s_obj</span><span class="p">)</span><span class="o">-&gt;*&amp;</span><span class="n">s</span><span class="o">::</span><span class="n">f</span><span class="p">)(</span><span class="n">arg1</span><span class="p">,</span> <span class="n">arg2</span><span class="p">)</span> </pre></div></div> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5968 Trac 1.4.3 Thomas Heller Sun, 09 Oct 2011 01:00:14 GMT <link>https://svn.boost.org/trac10/ticket/5968#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5968#comment:1</guid> <description> <p> This code works fine with gcc 4.6, which compiler do you have problems with? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Thomas Heller</dc:creator> <pubDate>Sun, 09 Oct 2011 03:28:09 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/5968#comment:2 https://svn.boost.org/trac10/ticket/5968#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> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.48.0</span> </li> </ul> <p> Fixed for msvc10 with <a class="changeset" href="https://svn.boost.org/trac10/changeset/74839" title="Fixing bug #5968 for msvc">[74839]</a>, thanks for reporting. </p> Ticket