Error C2664 in get_attributes

Help
magisystem
2014-02-28
2014-03-01
  • magisystem
    magisystem
    2014-02-28

    Hi there,

    I get the following error when trying to get the attribute set of a simple logger in a multithread environment (seems that the lock fails on the multi_thread_model):

    Error 1 error C2664: 'boost::log::v2s_mt_nt5::aux::shared_lock_guard<MutexT>::shared_lock_guard(MutexT &)' : cannot convert parameter 1 from 'const boost::log::v2s_mt_nt5::sources::multi_thread_model<MutexT>' to 'boost::log::v2s_mt_nt5::sources::multi_thread_model<MutexT> &' d:\trunk\sources\libraries\boost\1.54.0\include\boost\log\sources\basic_logger.hpp 414

    Here is a minimal code example that reproduces the error(at least for me):

    include <boost log="" sources="" logger.hpp="">

    int main(int argc, char *argv[])
    {
    boost::log::sources::logger_mt logger;
    boost::log::attribute_set tmpSet = logger.get_attributes();
    std::exit(0);
    }

    What am i doing wrong? Please give me an advice how to get the loggers attributes. Thanks in advance.

     
  • It's a bug in Boost.Log, I'll fix it for 1.56.