Boost C++ Libraries: Ticket #3534: [signals2] compile error with MSVC 2010 Beta 2 https://svn.boost.org/trac10/ticket/3534 <p> When trying to build a project that uses Signals2 in VC2010 beta 2, i got the error: </p> <pre class="wiki">boost/signals2/detail/tracked_objects_visitor.hpp(61): error C2668: 'boost::addressof' : ambiguous call to overloaded function \boost/utility/addressof.hpp(51): could be 'T *boost::addressof&lt;const T&gt;(T &amp;)' with [ T=lapi::ui::type_1::fn_label_change ] C:\Program Files\Microsoft Visual Studio 10.0\VC\include\xmemory(109): or '_Ty *std::addressof&lt;const T&gt;(_Ty &amp;)' [found using argument-dependent lookup] with </pre><p> Seems that it's finding std::addressof via ADL if the type passed to addressof is from namespace std;. </p> <p> Changing line 61 of tracked_objects_visitor.hpp to use boost::addressof explicitly allows it to compile. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3534 Trac 1.4.3 Frank Mori Hess Tue, 20 Oct 2009 23:53:18 GMT status changed https://svn.boost.org/trac10/ticket/3534#comment:1 https://svn.boost.org/trac10/ticket/3534#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Would you provide a minimal example program that generates the compile error, so I can add a test for it? </p> Ticket Richard Webb <richard.webb@…> Wed, 21 Oct 2009 10:42:06 GMT <link>https://svn.boost.org/trac10/ticket/3534#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3534#comment:2</guid> <description> <p> The following code results in the compile error: </p> <pre class="wiki">#include &lt;boost/signals2/signal.hpp&gt; #include &lt;functional&gt; typedef boost::signals2::signal&lt;void (bool)&gt; signal_t; typedef std::function&lt;void (bool) &gt; fn_t; int _tmain(int argc, _TCHAR* argv[]) { fn_t f; signal_t s; s.connect(f); return 0; } </pre><p> However, i ran the Boost regression tests with Beta2 yesterday, and a couple of the existing tests have failed with the same error. e.g. </p> <p> <a class="ext-link" href="http://tinyurl.com/ygpvfma"><span class="icon">​</span>http://tinyurl.com/ygpvfma</a> <a class="ext-link" href="http://tinyurl.com/pbmxfr"><span class="icon">​</span>http://tinyurl.com/pbmxfr</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Frank Mori Hess</dc:creator> <pubDate>Thu, 22 Oct 2009 02:05:20 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3534#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3534#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/57056" title="Qualify addressof call, refs #3534. ">[57056]</a>) Qualify addressof call, refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3534" title="#3534: Bugs: [signals2] compile error with MSVC 2010 Beta 2 (closed: fixed)">#3534</a>. </p> </description> <category>Ticket</category> </item> <item> <author>Richard Webb <richard.webb@…></author> <pubDate>Mon, 26 Oct 2009 10:32:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3534#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3534#comment:4</guid> <description> <p> The Trunk regression tests are all passing for VC10 now. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Frank Mori Hess</dc:creator> <pubDate>Sat, 07 Nov 2009 14:57:06 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3534#comment:5 https://svn.boost.org/trac10/ticket/3534#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</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/57450" title="Merged [57056] from trunk, closes #3534. ">[57450]</a>) Merged <a class="changeset" href="https://svn.boost.org/trac10/changeset/57056" title="Qualify addressof call, refs #3534. ">[57056]</a> from trunk, closes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3534" title="#3534: Bugs: [signals2] compile error with MSVC 2010 Beta 2 (closed: fixed)">#3534</a>. </p> Ticket