Opened 12 years ago
Closed 12 years ago
#4674 closed Bugs (duplicate)
output operator<< of thread::id
Reported by: | Owned by: | Anthony Williams | |
---|---|---|---|
Milestone: | To Be Determined | Component: | thread |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: |
Description
Hi,
std::cout << boost::this_thread::get_id();
produces:
thread.hpp(473) : error C2662: 'std::basic_ostream<_Elem,_Traits> &boost::thread::id::print<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &)' : cannot convert 'this' pointer from 'const boost::thread::id' to 'boost::thread::id &'
For me it was okay to comment the const out:
operator<<(std::basic_ostream<charT, traits>& os, /*const*/ thread::id& x) { return x.print(os); }
Greetings, Jan.
Note:
See TracTickets
for help on using tickets.
I suspect that the actual problem is that thread::id::print is not const, and the fix is to add that, rather than removing the const on operator <<