2
0
mirror of https://github.com/boostorg/log.git synced 2026-01-26 18:42:17 +00:00

write() no longer asserts when the stream wrapper is not attached to a string. Rather, it behaves more like a standard stream write() when the stream is bad.

[SVN r84514]
This commit is contained in:
Andrey Semashev
2013-05-26 16:04:10 +00:00
parent 31e0653960
commit da5669c3df

View File

@@ -355,11 +355,14 @@ public:
typename aux::enable_if_char_type< OtherCharT, basic_formatting_ostream& >::type
write(const OtherCharT* p, std::streamsize size)
{
m_stream.flush();
sentry guard(*this);
if (guard)
{
m_stream.flush();
string_type* storage = m_streambuf.storage();
BOOST_ASSERT(storage != NULL);
aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc());
string_type* storage = m_streambuf.storage();
aux::code_convert(p, static_cast< std::size_t >(size), *storage, m_stream.getloc());
}
return *this;
}