#include <boost/cstdint.hpp>
#include <boost/static_assert.hpp>
+#include <boost/core/swap.hpp>
#include <boost/smart_ptr/intrusive_ptr.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
+#include <boost/type_traits/is_nothrow_move_constructible.hpp>
#include <boost/log/detail/config.hpp>
#include <boost/log/detail/locks.hpp>
#include <boost/log/detail/default_attribute_names.hpp>
{
public:
//! The method dispatches the value to the given object
- bool dispatch(type_dispatcher& dispatcher)
+ bool dispatch(type_dispatcher& dispatcher) BOOST_OVERRIDE
{
type_dispatcher::callback< value_type > callback = dispatcher.get_callback< value_type >();
if (callback)
}
//! The method is called when the attribute value is passed to another thread
- intrusive_ptr< attribute_value::impl > detach_from_thread()
+ intrusive_ptr< attribute_value::impl > detach_from_thread() BOOST_OVERRIDE
{
#if !defined(BOOST_LOG_NO_THREADS)
return new attributes::attribute_value_impl< value_type >(
{
}
//! Copy constructor
- severity_level(severity_level const& that) : attribute(static_cast< attribute const& >(that))
+ severity_level(severity_level const& that) BOOST_NOEXCEPT : attribute(static_cast< attribute const& >(that))
{
}
//! Move constructor
- severity_level(BOOST_RV_REF(severity_level) that) : attribute(boost::move(static_cast< attribute& >(that)))
+ severity_level(BOOST_RV_REF(severity_level) that) BOOST_NOEXCEPT : attribute(boost::move(static_cast< attribute& >(that)))
{
}
//! Constructor for casting support
/*!
* Copy assignment
*/
- severity_level& operator= (BOOST_COPY_ASSIGN_REF(severity_level) that)
+ severity_level& operator= (BOOST_COPY_ASSIGN_REF(severity_level) that) BOOST_NOEXCEPT
{
- attribute::operator= (that);
+ attribute::operator= (static_cast< attribute const& >(that));
return *this;
}
/*!
* Move assignment
*/
- severity_level& operator= (BOOST_RV_REF(severity_level) that)
+ severity_level& operator= (BOOST_RV_REF(severity_level) that) BOOST_NOEXCEPT
{
this->swap(that);
return *this;
typedef typename strictest_lock<
typename base_type::swap_lock,
#ifndef BOOST_LOG_NO_THREADS
- boost::log::aux::exclusive_lock_guard< threading_model >
+ boost::log::aux::multiple_unique_lock2< threading_model, threading_model >
#else
no_lock< threading_model >
#endif // !defined(BOOST_LOG_NO_THREADS)
m_DefaultSeverity(that.m_DefaultSeverity),
m_SeverityAttr(that.m_SeverityAttr)
{
+ // Our attributes must refer to our severity attribute
base_type::attributes()[boost::log::aux::default_attribute_names::severity()] = m_SeverityAttr;
}
/*!
* Move constructor
*/
- basic_severity_logger(BOOST_RV_REF(basic_severity_logger) that) :
+ basic_severity_logger(BOOST_RV_REF(basic_severity_logger) that) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< base_type >::value &&
+ boost::is_nothrow_move_constructible< severity_level >::value &&
+ boost::is_nothrow_move_constructible< severity_attribute >::value) :
base_type(boost::move(static_cast< base_type& >(that))),
m_DefaultSeverity(boost::move(that.m_DefaultSeverity)),
m_SeverityAttr(boost::move(that.m_SeverityAttr))
{
- base_type::attributes()[boost::log::aux::default_attribute_names::severity()] = m_SeverityAttr;
}
/*!
* Constructor with named arguments. Allows to setup the default level for log records.
void swap_unlocked(basic_severity_logger& that)
{
base_type::swap_unlocked(static_cast< base_type& >(that));
- severity_level t = m_DefaultSeverity;
- m_DefaultSeverity = that.m_DefaultSeverity;
- that.m_DefaultSeverity = t;
+ boost::swap(m_DefaultSeverity, that.m_DefaultSeverity);
m_SeverityAttr.swap(that.m_SeverityAttr);
}
};