Opened 13 years ago

Closed 12 years ago

#3761 closed Patches (fixed)

Thread ignores BOOST_NO_MEMBER_TEMPLATE_FRIENDS

Reported by: Yuriy A. Krasnoschek <aka.rider@…> Owned by: Anthony Williams
Milestone: Boost 1.42.0 Component: thread
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

class thread::id in boost/thread/detail/thread.hpp has template friend operator <<

Attachments (1)

thread.diff (629 bytes ) - added by Yuriy A. Krasnoschek <aka.rider@…> 13 years ago.

Download all attachments as: .zip

Change History (4)

by Yuriy A. Krasnoschek <aka.rider@…>, 13 years ago

Attachment: thread.diff added

comment:1 by Steven Watanabe, 13 years ago

Component: Nonethread
Owner: set to Anthony Williams

comment:2 by anonymous, 12 years ago

Type: BugsPatches

Another possibility could be to define a public print function which is used by the operator<<

+# ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS

template<class charT, class traits> friend std::basic_ostream<charT, traits>&

  • operator<<(std::basic_ostream<charT, traits>& os, const id& x)

+ operator<< +# else + template<class charT, class traits> + static std::basic_ostream<charT, traits>& + print +# endif + (std::basic_ostream<charT, traits>& os, const id& x)

+# ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS + template<class charT, class traits> + std::basic_ostream<charT, traits>& + operator<<(std::basic_ostream<charT, traits>& os, const thread::id& x) + { + return thread::id::print(os, x); + } +# endif

comment:3 by Anthony Williams, 12 years ago

Resolution: fixed
Status: newclosed

Fixed on trunk.

Note: See TracTickets for help on using tickets.