Boost C++ Libraries: Ticket #9860: mem_fun_cxx98 doesn't compile with c++11 https://svn.boost.org/trac10/ticket/9860 <p> Using clang++ from XCode 5.1 on OSX 10.9.2, mem_fun_cxx98 won't compile, it gives this error: </p> <p> mem_fun_cxx98.cpp:34:46: error: invalid operands to binary expression ('std::<span class="underline">1::basic_ostream&lt;char&gt;' and 'ostream' (aka 'basic_ostream&lt;char&gt;')) </span></p> <blockquote> <p> BOOST_TEST(f2(&amp;x, boost::ref(std::cout)) == std::cout); </p> </blockquote> <p> ../../../boost/detail/lightweight_test.hpp:186:28: note: expanded from macro 'BOOST_TEST' #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, <span class="underline">FILE</span>, <span class="underline">LINE</span>, BOOST_CURRENT_FUNCTION)) 1 error generated. </p> <p> Peter Dimov suggested the following fix: </p> <p> It should probably say </p> <blockquote> <p> BOOST_TEST( &amp;f2(&amp;x, boost::ref(std::cout)) == &amp;std::cout ); </p> </blockquote> <p> You can say std::cout == std::cout in pre-C++11, but it doesn't do anything sensible. This no longer compiles in C++11. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9860 Trac 1.4.3 chris.cooper@… Wed, 09 Apr 2014 17:54:03 GMT <link>https://svn.boost.org/trac10/ticket/9860#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9860#comment:1</guid> <description> <p> The same problem exists (with the same solution) for mem_fun_portable.cpp </p> </description> <category>Ticket</category> </item> <item> <author>Niklas Angare <li51ckf02@…></author> <pubDate>Thu, 26 Jun 2014 22:40:26 GMT</pubDate> <title>owner, component changed https://svn.boost.org/trac10/ticket/9860#comment:2 https://svn.boost.org/trac10/ticket/9860#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">René Rivera</span> to <span class="trac-author">Douglas Gregor</span> </li> <li><strong>component</strong> <span class="trac-field-old">Regression Testing</span> → <span class="trac-field-new">function</span> </li> </ul> Ticket Marshall Clow Fri, 27 Jun 2014 15:15:52 GMT status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/9860#comment:3 https://svn.boost.org/trac10/ticket/9860#comment:3 <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.56.0</span> </li> </ul> <p> This has been fixed, but not made it into a release yet. It will be part of the 1.56.0 release. </p> <ul><li>commit 78eb6b1c8c2492fea1783c09e946d094a8a5e905 </li><li>Author: Marshall Clow &lt;marshall@…&gt; </li><li>Date: Mon Feb 3 11:46:05 2014 -0800 </li></ul><blockquote> <p> Fixed two tests to work with C++11/libc++. The tests attempted to compare two ostream&amp;, but didn't really. In c++03, both decayed to void *, which wre then compared. In c++11, the ostreams are comvertible to bool, but only explicitly, and this failed to compile. Use a custom struct with operator== instead of ostream in these tests instead. </p> </blockquote> Ticket