Boost C++ Libraries: Ticket #9286: signals2 compile error with MSVC12 and variadic templates https://svn.boost.org/trac10/ticket/9286 <p> With variadic templates enabled, the following code doesn't compile with Microsoft Visual C++ 12 (2013): </p> <p> boost::signals2::signal&lt;void (const std::wstring &amp;, int)&gt; someSignal; someSignal.connect(boost::bind(&amp;<a class="missing wiki">SomeMemberFunction</a>, this, _1, _2)); </p> <p> Making the variadic constructor explicit fixes the issue. Patch for variadic_slot.hpp (against trunk <a class="changeset" href="https://svn.boost.org/trac10/changeset/86387" title="Restored check for unsupported compilers">r86387</a>) attached. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9286 Trac 1.4.3 raad@… Tue, 22 Oct 2013 07:44:27 GMT attachment set https://svn.boost.org/trac10/ticket/9286 https://svn.boost.org/trac10/ticket/9286 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">variadic_slot.hpp.patch</span> </li> </ul> <p> Make variadic slot contructor explicit </p> Ticket raad@… Tue, 22 Oct 2013 08:17:35 GMT <link>https://svn.boost.org/trac10/ticket/9286#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9286#comment:1</guid> <description> <p> Sorry, it actually fixes only my use case, but of course breaks code using the implicit <a class="missing wiki">BindArgs</a>... constructor. </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Tue, 22 Oct 2013 09:43:51 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9286#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9286#comment:2</guid> <description> <p> The problem is that VC++12 prefers the variadic slot constructor over the non-variadic constructor, so calling slot(boost::bind(...)) always calls boost::bind(boost::bind(...)), which doesn't compile. </p> <p> If I understand the example in 14.8.2.4.8 of the January 2012 C++ working draft correctly, this is a compiler bug, so I have filed a bug on Microsoft Connect (ID 806150). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Frank Mori Hess</dc:creator> <pubDate>Thu, 24 Oct 2013 02:17:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9286#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9286#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86412" title="As per Peter Dimov's suggestion, the variadic binding constructor for ...">[86412]</a>) As per Peter Dimov's suggestion, the variadic binding constructor for slots shouldn't accept zero arguments. There is also no need for it to accept a single argument, and not doing so avoids a bug in MSVC12. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9286" title="#9286: Patches: signals2 compile error with MSVC12 and variadic templates (closed: fixed)">#9286</a> </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Thu, 24 Oct 2013 07:23:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9286#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9286#comment:4</guid> <description> <p> The code compiles file now. Thank you! </p> </description> <category>Ticket</category> </item> <item> <author>raad@…</author> <pubDate>Thu, 24 Oct 2013 07:23:40 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9286#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9286#comment:5</guid> <description> <p> The code compiles fine now. Thank you! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Frank Mori Hess</dc:creator> <pubDate>Fri, 25 Oct 2013 04:43:05 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9286#comment:6 https://svn.boost.org/trac10/ticket/9286#comment:6 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/86424" title="Merged changeset 86412 from trunk. Fixes #9286 ">[86424]</a>) Merged changeset 86412 from trunk. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9286" title="#9286: Patches: signals2 compile error with MSVC12 and variadic templates (closed: fixed)">#9286</a> </p> Ticket