Boost C++ Libraries: Ticket #7079: addressof a boost::function and SolarisStudio compiler https://svn.boost.org/trac10/ticket/7079 <p> This: </p> <pre class="wiki">#include &lt;boost/utility/addressof.hpp&gt; #include &lt;boost/function.hpp&gt; int main() { boost::function&lt;void (void)&gt; pFunc; boost::addressof(pFunc); return 0; } </pre><p> fails with: </p> <p> CC address-of.cpp -I/path/to/boost -library=stlport4 ".../addressof.hpp", line 61: Error: Could not find a match for boost::detail::addressof_impl&lt;boost::function&lt;void()&gt;&gt;::f(boost::detail::addr_impl_ref&lt;boost::function&lt;void()&gt;&gt;, int) needed in boost::addressof&lt;boost::function&lt;void()&gt;&gt;(boost::function&lt;void()&gt;&amp;). "address-of.cpp", line 8: Where: While instantiating "boost::addressof&lt;boost::function&lt;void()&gt;&gt;(boost::function&lt;void()&gt;&amp;)". "address-of.cpp", line 8: Where: Instantiated from non-template code. </p> <p> Handily the existing workaround in addressof.hpp fixes it if extended to check for Sun... </p> <pre class="wiki">template&lt;class T&gt; T * addressof( T &amp; v ) { #if (defined( __BORLANDC__ ) &amp;&amp; BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x610 ) ) ) || defined( __SUNPRO_CC ) return Boost::detail::addressof_impl&lt;T&gt;::f( v, 0 ); #else return Boost::detail::addressof_impl&lt;T&gt;::f( Boost::detail::addr_impl_ref&lt;T&gt;( v ), 0 ); #endif } </pre><p> Compiler info: </p> <pre class="wiki">CC -V CC: Sun C++ 5.12 SunOS_i386 2011/11/16 </pre><p> I'm not sure if this is really the correct solution (addressof_test passes), but I hope it is of some use! </p> <p> Regards </p> <p> Luke Elliott. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7079 Trac 1.4.3 Matt Stupple <matt_stupple@…> Thu, 30 Aug 2012 07:19:39 GMT <link>https://svn.boost.org/trac10/ticket/7079#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7079#comment:1</guid> <description> <p> Can I 'vote' for this fix to be integrated into the main Boost release? I hit exactly the same error with Solaris Studio 12.3 (CC 5.12) and the suggested solution works perfectly for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Mon, 04 Feb 2013 22:33:21 GMT</pubDate> <title>owner, status changed https://svn.boost.org/trac10/ticket/7079#comment:2 https://svn.boost.org/trac10/ticket/7079#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">No-Maintainer</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket viboes Sat, 23 Mar 2013 01:44:22 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7079#comment:3 https://svn.boost.org/trac10/ticket/7079#comment:3 <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/83524" title="Utility/address_off: fix #7079.">[83524]</a>) Utility/address_off: fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7079" title="#7079: Bugs: addressof a boost::function and SolarisStudio compiler (closed: fixed)">#7079</a>. </p> Ticket viboes Sat, 23 Mar 2013 01:45:05 GMT milestone changed https://svn.boost.org/trac10/ticket/7079#comment:4 https://svn.boost.org/trac10/ticket/7079#comment:4 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.54.0</span> </li> </ul> Ticket