Re: [Boost-bugs] [Boost C++ Libraries] #11998: Static const variables cannot be logged

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11998: Static const variables cannot be logged
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-25 12:42:31


#11998: Static const variables cannot be logged
----------------------------------------+------------------------------
  Reporter: Hendrik Schall <torres@…> | Owner: andysem
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: log
   Version: Boost 1.60.0 | Severity: Problem
Resolution: | Keywords: log static const
----------------------------------------+------------------------------

Comment (by o.z):

 I see similar problem using bitfields:

 I took the example from
 http://www.boost.org/doc/libs/1_61_0/libs/log/example/doc/tutorial_trivial_flt.cpp
 and added a bitfield print:


 {{{
 #include <boost/log/core.hpp>
 #include <boost/log/trivial.hpp>
 #include <boost/log/expressions.hpp>

 namespace logging = boost::log;

 //[ example_tutorial_trivial_with_filtering
 void init()
 {
     logging::core::get()->set_filter
     (
         logging::trivial::severity >= logging::trivial::info
     );
 }


 struct BF {
                 unsigned int b : 8;
                 BF() : b(0) {}
 };


 int main(int, char*[])
 {
     init();

     BF bf;
     BOOST_LOG_TRIVIAL(info) << "An informational severity message " <<
 bf.b;

     return 0;
 }
 //]
 }}}


 With boost 1.60 I got a compilation error:


 {{{
 cannot bind bitfield 'bf.BF::b' to 'unsigned int&'
 }}}

 With boost 1.57 the code is compiled and run (prints: [2016-09-19
 20:21:33.018112] [0x000007fd1d5be672] [info] An informational severity
 message 0)

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11998#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC