/usr/include/boost/log/attributes
NameSizeModeActions
attribute.hpp52300644editdlrm
attribute_cast.hpp17800644editdlrm
attribute_name.hpp57990644editdlrm
attribute_set.hpp171400644editdlrm
attribute_value.hpp162770644editdlrm
attribute_value_impl.hpp40750644editdlrm
attribute_value_set.hpp169540644editdlrm
clock.hpp26870644editdlrm
constant.hpp35470644editdlrm
counter.hpp30720644editdlrm
current_process_id.hpp16900644editdlrm
current_process_name.hpp17030644editdlrm
current_thread_id.hpp28850644editdlrm
fallback_policy.hpp47310644editdlrm
fallback_policy_fwd.hpp13120644editdlrm
function.hpp46120644editdlrm
mutable_constant.hpp91400644editdlrm
named_scope.hpp149750644editdlrm
scoped_attribute.hpp81410644editdlrm
timer.hpp24690644editdlrm
time_traits.hpp19670644editdlrm
value_extraction.hpp349270644editdlrm
value_extraction_fwd.hpp15940644editdlrm
value_visitation.hpp136120644editdlrm
value_visitation_fwd.hpp11500644editdlrm
Edit: /usr/include/boost/log/attributes/constant.hpp (3547B)
/* * Copyright Andrey Semashev 2007 - 2015. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ /*! * \file constant.hpp * \author Andrey Semashev * \date 15.04.2007 * * The header contains implementation of a constant attribute. */ #ifndef BOOST_LOG_ATTRIBUTES_CONSTANT_HPP_INCLUDED_ #define BOOST_LOG_ATTRIBUTES_CONSTANT_HPP_INCLUDED_ #include #include #include #include #include #include #include #include #include #include #ifdef BOOST_HAS_PRAGMA_ONCE #pragma once #endif namespace boost { BOOST_LOG_OPEN_NAMESPACE namespace attributes { /*! * \brief A class of an attribute that holds a single constant value * * The constant is a simplest and one of the most frequently used types of attributes. * It stores a constant value, which it eventually returns as its value each time * requested. */ template< typename T > class constant : public attribute { public: //! Attribute value type typedef T value_type; protected: //! Factory implementation class BOOST_SYMBOL_VISIBLE impl : public attribute_value_impl< value_type > { //! Base type typedef attribute_value_impl< value_type > base_type; public: /*! * Constructor with the stored value initialization */ explicit impl(value_type const& value) : base_type(value) {} /*! * Constructor with the stored value initialization */ explicit impl(BOOST_RV_REF(value_type) value) BOOST_NOEXCEPT_IF(boost::is_nothrow_move_constructible< value_type >::value) : base_type(boost::move(value)) { } }; public: /*! * Constructor with the stored value initialization */ explicit constant(value_type const& value) : attribute(new impl(value)) {} /*! * Constructor with the stored value initialization */ explicit constant(BOOST_RV_REF(value_type) value) : attribute(new impl(boost::move(value))) {} /*! * Constructor for casting support */ explicit constant(cast_source const& source) : attribute(source.as< impl >()) { } /*! * \return Reference to the contained value. */ value_type const& get() const { return static_cast< impl* >(this->get_impl())->get(); } }; /*! * The function constructs a \c constant attribute containing the provided value. * The function automatically converts C string arguments to \c std::basic_string objects. */ template< typename T > inline constant< typename boost::log::aux::make_embedded_string_type< typename remove_reference< T >::type >::type > make_constant(BOOST_FWD_REF(T) val) { typedef typename boost::log::aux::make_embedded_string_type< typename remove_reference< T >::type >::type value_type; return constant< value_type >(boost::forward< T >(val)); } } // namespace attributes BOOST_LOG_CLOSE_NAMESPACE // namespace log } // namespace boost #include #endif // BOOST_LOG_ATTRIBUTES_CONSTANT_HPP_INCLUDED_