Boost C++ Libraries: Ticket #11549: ostream& operator<< overload no longer picked up by boost log https://svn.boost.org/trac10/ticket/11549 <p> Boost log does no longer seem to reliably pick up custom stream operators in boost 1.59.0 (tested with vc14 and vc12). In the example given below the custom operator works fine for cout but isn't found when trying to use it normally for logging. The operator is however found if something else is piped in first. Compiling the same example with 1.58.0 (only tested with vc12) works as expected. </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;ostream&gt; #include &lt;boost/log/trivial.hpp&gt; struct Mine {}; std::ostream&amp; operator &lt;&lt; (std::ostream&amp; t, const Mine&amp; m) { t &lt;&lt; "Works"; return t; }; int main() { Mine m; std::cout &lt;&lt; m &lt;&lt; std::endl; // Works BOOST_LOG_TRIVIAL(warning) &lt;&lt; m; // error C2678: binary '&lt;&lt;': no operator found which takes a left-hand operand of type 'boost::log::v2s_mt_nt5::basic_record_ostream&lt;char&gt;' (or there is no acceptable conversion) BOOST_LOG_TRIVIAL(warning) &lt;&lt; "" &lt;&lt; m; // Works return 0; }; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11549 Trac 1.4.3 Alexander Filonov <kingsbfs@…> Wed, 19 Aug 2015 13:25:08 GMT <link>https://svn.boost.org/trac10/ticket/11549#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11549#comment:1</guid> <description> <p> This also breaks all logging whenever <strong>boost::format</strong> is used for record formatting. On MVC12 compiler I get the following error: </p> <pre class="wiki">error C2679: binary '&lt;&lt;' : no operator found which takes a right-hand operand of type 'boost::basic_format&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt;&gt;' (or there is no acceptable conversion) </pre><p> as a temporary solution I redefined my log macro to add an extra empty string: </p> <pre class="wiki">#define LOG(lg,sev) BOOST_LOG_SEV(lg, sev) &lt;&lt; "" </pre> </description> <category>Ticket</category> </item> <item> <author>Alexander Filonov <kingsbfs@…></author> <pubDate>Wed, 19 Aug 2015 13:29:28 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/11549#comment:2 https://svn.boost.org/trac10/ticket/11549#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">kingsbfs@…</span> added </li> </ul> Ticket Andrey Semashev Sun, 23 Aug 2015 14:32:39 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11549#comment:3 https://svn.boost.org/trac10/ticket/11549#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="ext-link" href="https://github.com/boostorg/log/commit/7da193fde1a9c1bc925ee980339f4df2e1a66fa7"><span class="icon">​</span>https://github.com/boostorg/log/commit/7da193fde1a9c1bc925ee980339f4df2e1a66fa7</a>. Thanks for the report. </p> Ticket