2015-08-24 44 views
6

下面的代码按预期工作与提升1.57。第一个gcc错误信息是:问题与升压日志,版本1.59

error: no match for ‘operator<<’ (operand types are ‘boost::log::v2s_mt_posix::basic_record_ostream’ and ‘Foo’)

文档和发行说明都未记录需要更改的内容。

+0

直播版本:http://melpon.org/wandbox/permlink/Xn1hDoe7Zg7cynRX看起来'enable_if_formatting_ostream'坏了。 – ForEveR

回答

4

Live version 看起来像问题在enable_if_formatting_ostream结构。它被添加到this commit。貌似

template< typename StreamT, typename R > 
struct enable_if_formatting_ostream {}; 
template< typename CharT, typename TraitsT, typename AllocatorT, typename R > 
struct enable_if_formatting_ostream< basic_formatting_ostream< CharT, TraitsT, AllocatorT >, R > { typedef R type; }; 

现在operator <<

template< typename StreamT, typename T > 
inline typename boost::log::aux::enable_if_formatting_ostream< StreamT, StreamT& >::type 
operator<< (StreamT& strm, T const& value) 

之前,它是

template< typename CharT, typename TraitsT, typename AllocatorT, typename T > 
inline basic_formatting_ostream< CharT, TraitsT, AllocatorT >& 
operator<< (basic_formatting_ostream< CharT, TraitsT, AllocatorT >& strm, T const& value) 

,自record_ostreamformatting_ostream编译器导出可以找到过载,但现在不是,因为SFINAE是仅当使用formatting_ostream时,使用和结构将具有type typedef。而this可以解决这种情况。

+3

查看boost trac后,记录并修复了这个错误:https://svn.boost.org/trac/boost/ticket/11549 –

+1

究竟是如何通过回归测试? –