Opened 9 years ago
Closed 9 years ago
#9286 closed Patches (fixed)
signals2 compile error with MSVC12 and variadic templates
Reported by: | Owned by: | Frank Mori Hess | |
---|---|---|---|
Milestone: | To Be Determined | Component: | signals2 |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
With variadic templates enabled, the following code doesn't compile with Microsoft Visual C++ 12 (2013):
boost::signals2::signal<void (const std::wstring &, int)> someSignal; someSignal.connect(boost::bind(&SomeMemberFunction, this, _1, _2));
Making the variadic constructor explicit fixes the issue. Patch for variadic_slot.hpp (against trunk r86387) attached.
Attachments (1)
Change History (7)
by , 9 years ago
Attachment: | variadic_slot.hpp.patch added |
---|
comment:1 by , 9 years ago
Sorry, it actually fixes only my use case, but of course breaks code using the implicit BindArgs... constructor.
comment:2 by , 9 years ago
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.
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).
comment:3 by , 9 years ago
comment:6 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Make variadic slot contructor explicit