id summary reporter owner description type status milestone component version severity resolution keywords cc 4565 Stream operator overload for thread::id fails because thread::id::print() is not const. David Larsson Anthony Williams "In Boost 1.44.0 the implementation of `operator<<( basic_stream &, thread::id const & )` changed when `BOOST_NO_MEMBER_TEMPLATE_FRIENDS` is defined to call a new member function `print()`. However, `thread::id::print()` is not `const`, so the following (admittedly silly) code fragment will not compile: {{{ std::cout << thread::current_thread::id() << std::endl; }}} On VC8 it fails with the error ''boost/thread/detail/thread.hpp(473) : error C2662: 'std::basic_ostream<_Elem,_Traits> &boost::thread::id::print>(std::basic_ostream<_Elem,_Traits> &)' : cannot convert 'this' pointer from 'const boost::thread::id' to 'boost::thread::id &'''. The fix should be trivial - simply add a `const` modifier to `boost::id::print`. On a related note, it seems a bit strange that the public method `print()` only is defined for legacy compilers that have `BOOST_NO_MEMBER_TEMPLATE_FRIENDS`. It should be private or exist for all compilers. Finally, the code that failed is a workaround that is enabled for VC8 and earlier, but the stream operator worked for `thread::id` on VC8 before the workaround in Boost 1.43. Is it really necessary to define `BOOST_NO_MEMBER_TEMPLATE_FRIENDS` for VC8 (VS2005)? Thanks for a great library, ''/ David'' " Bugs closed Website 1.X thread Boost 1.51.0 Problem fixed