id summary reporter owner description type status milestone component version severity resolution keywords cc 6555 output_test_stream does not play nicely with std::ref() (GCC 4.6.1, C++2011 mode) greenc@… Gennadiy Rozental "Under GCC 4.6.1 with Boost 1.48.0 and C++2011 turned on (as it was for the compile of Boost), the following code fails to compile (with appropriate wrapping): {{{#!C++ boost::test_tools::output_test_stream os; (void) std::ref(os); }}} The relevant part of the error message is (I believe): {{{ .../include/boost/test/output_test_stream.hpp:42:37: error: 'typedef class boost::test_tools::predicate_result boost::test_tools::output_test_stream::result_type' is private .../bin/../lib/gcc/x86_64-unknown-linux-gnu/4.6.1/../../../../include/c++/4.6.1/functional:74:46: error: within this context }}} It seems that the GCC `std::ref()` function is trying to pick out a nested `result_type` if defined in order to ascertain whether `output_test_stream` is callable. Unfortunately `result_type` is defined but private, which causes a compile error in the template code. Solutions: (1) Use `predicate_result` directly instead of using a typedef at all. (2) Make the typedef public (may cause problems based on what `std::ref()` does next when it '''does''' think output_test_stream is callable). (3) Call it something other than `result_type`. Thanks for your help." Bugs closed To Be Determined test Boost 1.48.0 Problem fixed C++2011