Opened 7 years ago

Closed 7 years ago

#11545 closed Bugs (fixed)

Sentry problem

Reported by: lcarreon@… Owned by: Andrey Semashev
Milestone: To Be Determined Component: log
Version: Boost 1.59.0 Severity: Problem
Keywords: sentry Cc:

Description

I compiled Boost 1.59.0 with Solaris Studio 12.4 in C++11 mode and I get the following error messages:

"./boost/log/utility/formatting_ostream.hpp", line 627: Error: Cannot use boost::log::v2_mt_posix::basic_formatting_ostream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>::sentry to initialize bool.

It seems that the problem here is that the conversion operator of the sentry base class is not exposed by the derived class. The fix I found suggested defining the required conversion operator on the derived class. Add the following line in boost/log/utility/formatting_ostream.hpp:

operator bool() { return base_type::operator bool(); }

after the lines:

BOOST_DELETED_FUNCTION(sentry(sentry const&))

BOOST_DELETED_FUNCTION(sentry& operator= (sentry const&))

Change History (2)

comment:1 by Andrey Semashev, 7 years ago

Please, see #11064. Could you try one of the workarounds proposed there?

comment:2 by Andrey Semashev, 7 years ago

Resolution: fixed
Status: newclosed

Hopefully, fixed in https://github.com/boostorg/log/commit/c2789a4eff282867f7ea79dbfde08d0b90389aae. Not tested as I don't have the compiler.

Note: See TracTickets for help on using tickets.