[Boost-bugs] [Boost C++ Libraries] #9860: mem_fun_cxx98 doesn't compile with c++11

Subject: [Boost-bugs] [Boost C++ Libraries] #9860: mem_fun_cxx98 doesn't compile with c++11
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-09 16:56:28


#9860: mem_fun_cxx98 doesn't compile with c++11
------------------------------+--------------------------------
 Reporter: chris.cooper@… | Owner: grafik
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: Regression Testing
  Version: Boost 1.54.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------------
 Using clang++ from XCode 5.1 on OSX 10.9.2, mem_fun_cxx98 won't compile,
 it gives this error:

 mem_fun_cxx98.cpp:34:46: error: invalid operands to binary expression
 ('std::__1::basic_ostream<char>' and 'ostream' (aka
 'basic_ostream<char>'))
     BOOST_TEST(f2(&x, boost::ref(std::cout)) == std::cout);
 ../../../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, __FILE__, __LINE__,
 BOOST_CURRENT_FUNCTION))
 1 error generated.

 Peter Dimov suggested the following fix:

 It should probably say

     BOOST_TEST( &f2(&x, boost::ref(std::cout)) == &std::cout );

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9860>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC